python,pip 这些自己安装。
pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl
如果上面的不行,执行下面这个。
pip3 install https://pypi.python.org/packages/9c/9b/c20aab2499ad42b4f473bb17749bbb42dc797a2b083c86dce6abb90111f3/tensorflow-1.2.0rc1-cp36-cp36m-manylinux1_x86_64.whl#md5=fecda7af7028e73871840c917d1d52a8
tensorflow测试
>>> import tensorflow as tf
>>> hello = tf.constant("hello,TensorFlow!")
>>> sess = tf.Session()
2017-11-14 19:14:11.783266: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
2017-11-14 19:14:11.783310: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
2017-11-14 19:14:11.783318: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
2017-11-14 19:14:11.783324: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
2017-11-14 19:14:11.783330: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.
>>> print(sess.run(hello))
b'hello,TensorFlow!'
>>> a = tf.contant(10)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'tensorflow' has no attribute 'contant'
>>> a = tf.constant(10)
>>> b = tf.constant(32)
>>> print(sess.run(a+b))
42
>>>
>>> exit()
#上面的代码出现了tensorflow的警告。如何关闭?参见参考最后一条链接。
参考:
http://blog.youkuaiyun.com/guotch/arcticle/details/72983856?utm_source=itdadao&utm_medium=referral
http://blog.youkuaiyun.com/nicholas_wong/article/details/70215127