您的位置:首页 > 其它

windows上安装tensorflow

2017-10-15 11:49 459 查看
转载于
http://blog.csdn.net/u013713117/article/details/54616460


安装python3.5.x

下载:python3.5.2



安装: 


 

第一个Install Now是默认安装在c盘的,第二个是自己选择安装路径。 

我选择第二个,同时将Add Python 3.5 to PATH勾选上。 


 

这一步可以都勾选上。 


 

这一步的时候我没有勾选最后一项,虽然安装成功了,但是运行的时候报错,所以最好都选上。然后开始进行安装。 




 

安装成功。


安装tensorflow

> pip install tensorflow
# 或
> pip install --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-0.12.0rc0-cp35-cp35m-win_amd64.whl
1
2
3
4

GPU版本
> pip install tensorflow-gpu  # 需CUDA 8
# 或
> pip install --upgrade https://storage.googleapis.com/tensorflow/windows/gpu/tensorflow_gpu-0.12.0rc0-cp35-cp35m-win_amd64.whl[/code]1 2
3

安装成功后运行
>import tensorflow as tf
1

如果没有勾选Download debug binaries (requires VS 2015 or later ),报错:
Traceback (most recent call last):
File "C:\Users\mark\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 19, in swig_import_helper
return importlib.import_module(mname)
File "C:\Users\mark\AppData\Local\Programs\Python\Python35\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 986, in _gcd_import
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 666, in _load_unlocked
File "<frozen importlib._bootstrap>", line 577, in module_from_spec
File "<frozen importlib._bootstrap_external>", line 906, in create_module
File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
ImportError: DLL load failed: The specified module could not be found.
1
2
3
4
5
6
7
8
9
10
11
12
13

解决方法: 

Install Microsoft Visual C++ 2015 Redistributable Update 3 x64.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: