您的位置:首页 > 编程语言 > Python开发

win10安装tensorflow1.5+CUDA9.0+cuDNN7.1+anaconda3+python3.6.3

2018-02-02 19:55 711 查看
tensorflow官网教程还是老版本的,

https://www.tensorflow.org/install/install_windows

Ensure you meet the following requirements before you install cuDNN.
A GPU of compute capability 3.0 or higher. To understand the compute capability of the GPU on your system, see: CUDA GPUs.
One of the following supported platforms:
Windows 7
Windows 10
One of the following supported CUDA versions and NVIDIA graphics driver:
**NVIDIA graphics driver 377.55 or newer for CUDA 8**
**NVIDIA graphics driver 385.54 or newer for CUDA 9**


安装之前确定自己有GPU,以及更新对应CUDA版本的显卡驱动,不必安装最新的,选满足要求的稳定版本。

本机64-bit, x86 安装用的是CUDA9.0(注意目前tensorflow1.5只适配到CUDA9.0,CUDA9.1不适配,9.0在官网注册下填个表就可以下了),跟着quick-guide走一遍安装,cuDNN7.1

Installing cuDNN on Windows
The following steps describe how to build a cuDNN dependent program. In the following sections:
your CUDA directory path is referred to as C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0
your cuDNN directory path is referred to as <installpath>
Navigate to your <installpath> directory containing cuDNN.
Unzip the cuDNN package.
cudnn-9.0-windows7-x64-v7.zip
or
cudnn-9.0-windows10-x64-v7.zip
Copy the following files into the CUDA Toolkit directory.(复制相应文件到CUDA路径下)
Copy <installpath>\cuda\bin\cudnn64_7.dll to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin.
Copy <installpath>\cuda\ include\cudnn.h to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\include.
Copy <installpath>\cuda\lib\x64\cudnn.lib to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\lib\x64.
Set the following environment variables to point to where cuDNN is located. To access the value of the $(CUDA_PATH) environment variable, perform the following steps:
Open a command prompt from the Start menu.
Type Run and hit Enter.
Issue the control sysdm.cpl command.
Select the Advanced tab at the top of the window.
Click Environment Variables at the bottom of the window.
Ensure the following values are set:(设置环境变量)
Variable Name: CUDA_PATH
Variable Value: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0
Include cudnn.lib in your Visual Studio project.
Open the Visual Studio project and right-click on the project name.
Click Linker > Input > Additional Dependencies.
Add cudnn.lib and click OK.


以上准备工作完成后,按照这位博主的流程安装Anaconda3+python3.6即可。

1.打开cmd,输入运行:

conda create -n tensorflow
y


2.

activate tensorflow


3.

pip install --ignore-installed --upgrade tensorflow-gpu


可能遇到报错:

TypeError: parse() got an unexpected keyword argument 'transport_encoding'


解决

conda install -c anaconda html5lib


4.打开ipython,测试

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


输出b”Hello, TensorFlow!”,全部安装成功!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐