環境:centos7html
yum install python
yum -y install epel-release
yum install pippython
#修改pip源(http://www.cnblogs.com/microman/p/6107879.html)linux
vi ~/.pip/pip.confgit
[global] index-url=https://mirrors.aliyun.com/pypi/simple/ [install] trusted-host=mirrors.aliyun.com
# 從https://github.com/tensorflow/tensorflow下載對應版本的whl文件,必定要下載nightly的,每日構建的。在執行如下代碼
pip install /opt/tf_nightly-1.head-cp27-none-linux_x86_64.whlgithub
#python執行如下代碼centos
import tensorflow as tf hello = tf.constant('Hello, TensorFlow!') sess = tf.Session() sess.run(hello) a = tf.constant(10) b = tf.constant(32) sess.run(a + b) sess.close()