1、安装VirutalEnv
sudo pip install --upgrade virtualenv
2、创建工作目录
virtualenv --system-site-packages -p python3 /work/code/ai/
3、进入工作目录
source /work/code/ai/bin/activate
4、安装TensorFlow
pip install --upgrade tensorflow
5、验证安装情况,输入Python命令模式
# Python
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))
6、查看输出结果

安装成功
网友评论