[深度学习]tensorflow模块安装与测试
tensorflow
一个面向所有人的开源机器学习框架
项目地址:https://gitcode.com/gh_mirrors/te/tensorflow
免费下载资源
·
安装
第一步:安装pip
npm install pip
第2步:安装命令
pip install https://storage.googleapis.com/tensorflow/mac/tensorflow-0.5.0-py2-none-any.whl
第3步:测试 导入tensorflow如果不报错就成功
promote:~ apple$ import tensorflow
测试案例:
promote:~ apple$ python
Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec 5 2015, 12:54:16)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sklearn/cross_validation.py:44: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. Also note that the interface of the new CV iterators are different from that of this module. This module will be removed in 0.20.
"This module will be removed in 0.20.", DeprecationWarning)
>>> cat hello_tensorflow.py
File "<stdin>", line 1
cat hello_tensorflow.py
^
SyntaxError: invalid syntax
>>> import tensorflow as tf
>>> hello = tf.constant('Hello, TensorFlow!')
>>> meaning = tf.constant('The Answer to Life, the Universe and Everything is ')
>>> sess = tf.Session()
>>> msg_op = sess.run(hello)
>>> mean_op = sess.run(meaning)
>>> print(msg_op)
Hello, TensorFlow!
>>> print(mean_op)
The Answer to Life, the Universe and Everything is
>>> a = tf.constant(10)
>>> b = tf.constant(32)
>>> cal_op = sess.run(a + b)
>>> print(cal_op)
42
>>> sess.close()
>>>
GitHub 加速计划 / te / tensorflow
184.55 K
74.12 K
下载
一个面向所有人的开源机器学习框架
最近提交(Master分支:2 个月前 )
a49e66f2
PiperOrigin-RevId: 663726708
2 个月前
91dac11a
This test overrides disabled_backends, dropping the default
value in the process.
PiperOrigin-RevId: 663711155
2 个月前
更多推荐
已为社区贡献3条内容
所有评论(0)