1. 创建一个虚拟环境
conda create --name tensorflow_cpu python=3.5
2. 激活环境
source activate tensorflow_cpu
3. pip 安装指定版本的tensorflow
pip --default-timeout=1000 install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow==1.15.0
4. pip 安装jupyter notebook
pip --default-timeout=1000 install -i https://pypi.tuna.tsinghua.edu.cn/simple jupyter
5. 测试
进入jupyter notebook 新建一个python3 file下进行测试。
import tensorflow as tf
a = tf.constant(1)
b = tf.constant(2)
c = tf.add(a, b)
sess = tf.Session()
sess.run(c)