1.首先确保已经安装python,而后用pip来安装matplotlib模块。python
2.进入到cmd窗口下,建议执行python -m pip install -U pip setuptools进行升级。c++
3.若是以前已经安装了Numpy,则须要先卸载以前的安装,由于每一个Tensorflow都有一个版本的numpy对应,故要卸载以前numpygit
4.接着键入python -m pip install --upgrade tensorflow 进行自动的安装,系统会自动下载安装包。github
命令提交之后,你惟一能作的就是等待了。你惟一能祈祷的,就是这该死的GFW不会坏了你好事。 还好此次运气不错,一次搞定。windows
在桌面上建立a.py文件,写入如下代码bash
import tensorflow as tf import os os.environ['TF_CPP_MIN_LOG_LEVEL']= '2' hello = tf.constant('Hello, TensorFlow!') sess = tf.Session() print(sess.run(hello)) a = tf.constant(10) b = tf.constant(25) print(sess.run(a + b))
参考:markdown
win10安装TensorFlow填坑笔记:http://blog.csdn.net/chewinggum/article/details/70373098学习
【TensorFlow】Windows10 64 位下安装 TensorFlow - 官方原生支持:http://blog.csdn.net/u010099080/article/details/53418159测试
Windows下安装tensorflow步骤:http://blog.csdn.net/chongtong/article/details/53905625?locationNum=6&fps=1spa
TensorFlow 安装教程:http://blog.csdn.net/bitcarmanlee/article/details/52749488
学习:
知乎:https://www.zhihu.com/question/49909565
极客:http://wiki.jikexueyuan.com/project/tensorflow-zh/
下面是从网上找到的,别人在安装的过程当中出现的错误或异常,以及解决方法:
后来直接pip install tensorflow,tensorflow装完,自动装numpy却报错了。由于我以前本身用了numpy,早就装了。而每一个tensorflow都有一个版本的numpy对应,故要卸载以前numpy。解决方法以下
1.Exception:
Traceback (mostrecent call last):
……
PermissionError:[Errno 13]
Permission denied:'D:\\software\\Anaconda\\Lib\\site-packages\\numpy\\core\\multiarray.cp36-win_amd64.pyd'
解决办法:关闭全部正在运行的python程序
2. Installing collected packages:numpy, tensorflow-tensorboard, tensorflow
Found existing installation: numpy 1.11.3
Uninstalling numpy-1.11.3:
Exception……
没法卸载numpy
解决办法:pip install tensorflow –ignore-installed numpy
出处:https://blog.csdn.net/xuyunyunaixuexi/article/details/81036156
=============================================================
官方安装连接
tensorflow 0.12.0开始支持Windows下安装了
python.exe -m pip install --upgrade pip
pip install --upgrade tensorflow
pip install --upgrade tensorflow-gpu
添加解压后的bin目录到PATH环境变量
$ python
...
>>> import tensorflow as tf
>>> hello = tf.constant('Hello, TensorFlow!')
>>> sess = tf.Session()
>>> print(sess.run(hello))
b'Hello, TensorFlow!'
>>> a = tf.constant(10)
>>> b = tf.constant(32)
>>> print(sess.run(a + b))
42
>>>
若是import报错,须要下载安装Microsoft Visual C++ 2015 Redistributable
另外需确认CUDA CUDNN与TensorFlow版本是否匹配
nvidia-smi -l # 实时返回GPU使用状况