一、下载anaconda并安装
二、安装tensorflow
打开Anaconda Prompt
1、修改Anaconda 安装源:
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes
2、修改pip安装源
在D:\Users\当前用户\pip下增加pip.ini,内容如下
[global]
index-url=
[install]
trusted-host=mirrors.aliyun.com
3、安装tensorflow
conda create -n tensorflow python=3.6
activate tensorflow
pip install --ignore-installed --upgrade tensorflow
或
pip install --ignore-installed --upgrade tensorflow-gpu #(GPU版)
4、验证安装
https://www.tensorflow.org/install/install_windows (Validate your installation)
$ python
Enter the following short program inside the python interactive shell:
>>> import tensorflow as tf
>>> hello = tf.constant('Hello, TensorFlow!')
>>> sess = tf.Session()
>>> print(sess.run(hello))
If the system outputs the following, then you are ready to begin writing TensorFlow programs:
Hello, TensorFlow!
三、安装CUDA Toolkit(可选)