linux下安装TensorFlow及测试

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接: https://blog.csdn.net/Discoverhfub/article/details/85272979

Python 2.7
// CPU版本
pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.4.0-cp27-none-linux_x86_64.whl

// GPU版本
pip install https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.4.0-cp27-none-linux_x86_64.whl

如有错误
用 pip --user install

测试安装是否成功

编写python脚本 test.py

import tensorflow as tf
hello = tf.constant(‘Hello,TensorFlow!’)
sess = tf.Session()
print(sess.run(hello))
a = tf.constant(10)
b = tf.constant(32)
print(sess.run(a + b))

运行 python test.py 显示Hello,TensorFlow!即可

猜你喜欢

转载自blog.csdn.net/Discoverhfub/article/details/85272979