[深度学习]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()
>>>




一个面向所有人的开源机器学习框架
最近提交(Master分支:20 天前 )
4f64a3d5
Instead, check for this case in `ResolveUsers` and `ResolveOperand`, by querying whether the `fused_expression_root` is part of the `HloFusionAdaptor`.
This prevents us from stepping into nested fusions.
PiperOrigin-RevId: 724311958
20 天前
aa7e952e
Fix a bug in handling negative strides, and add a test case that exposes it.
We can have negative strides that are not just -1, e.g. with a combining
reshape.
PiperOrigin-RevId: 724293790
20 天前
更多推荐
所有评论(0)