前提 Anaconda3 已经安装成功
第一步:设置 Anaconda 仓库镜像,因为默认连接的是国外镜像地址,下载速度比较慢,将镜像地址改为清华大学开源软件镜像站,
打开 Anaconda Prompt, 输入:
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes
第二步:安装TensorFlow
在Anaconda Prompt, 输入:
conda create -n tensorflow python=3.5
按回车。表示创建 TensorFlow 依赖环境,TensorFlow 目前不支持Python3.6,这里我们使用Python3.5。
继续看控制台输出:输入y
第三步:安装 CPU 版本
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/ https://mirrors.tuna.tsinghua.edu.cn/tensorflow/windows/cpu/tensorflow-1.1.0-cp35-cp35m-win_amd64.whl
第四步:激活 TensorFlow 虚拟环境
activate tensorflow
第五步:测试
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
sess.run(hello)
参考:点击打开链接