windows10 64位 安装 tensorflow

tensorflow中文网站有写安装的过程https://www.tensorflow.org/install/install_windows#common_installation_problems

基于这个标准安装过程,再加上实践中总结的补充,比如添加清华镜像,更新pip等等就可以安装好了(不同电脑环境依赖不同造成标准安装过程在许多情况下不work)。

  1. 建议在执行之前,先添加清华镜像:

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
conda config --set show_channel_urls yes

安装后建议打开一个新的cmd窗口, 然后再创建TensorFlow环境,这里安装的是不带gpu的

依次执行如下命令(我的电脑安装时pip版本旧而且需要项目需要使用python3.5,所以过程略繁琐,适合我自己,

项目对环境无要求的可看如下链接的教程 https://www.jianshu.com/p/401e18aa3503   ,如果这个教程安装过程中失败旧照着我的来):

1.   conda create -n tensorflow pip python=3.5

2.   activate tensorflow

3.   pip install --ignore-installed --upgrade tensorflow

4.   python -m pip install --upgrade pip

5.    pip -V

扫描二维码关注公众号,回复: 2177052 查看本文章

6.    python -m pip install --upgrade pip


7.   pip install --ignore-installed --upgrade tensorflow


8.    pip install ipykernel

9.    pip install jupyter

10.  pip install bleach==1.5.0

11.  pip install jupyter-console

12.  pip install jupyter

13.  pip install --ignore-installed --upgrade tensorflow

测试是否安装成功:

python
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))


猜你喜欢

转载自blog.csdn.net/han____shuai/article/details/80057262