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)

本文详细介绍了如何使用conda创建虚拟环境,并在该环境中安装特定版本的TensorFlow和Jupyter Notebook,最后通过一个简单的例子验证了安装是否成功。
1534

被折叠的 条评论
为什么被折叠?



