1.安装pip
yum -y install epel-release
yum install python-pip python-dev
pip install --upgrade pip
2.下载tensorflow-1.0.0-cp27-none-linux_x86_64.whl
之后pip安装:pip install tensorflow-1.0.0-cp27-none-linux_x86_64.whl
3.测试,建立test.py(os.environ['TF_CPP_MIN_LOG_LEVEL']='2',屏蔽了一些警告,主要是用来加速处理,除非用源码安装才不会有这些警告)
import os
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
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)
4.python test.py