(1)打开NVIDIA控制面板(点击鼠标右键就能找到)
为了方便,我把cuda9.0和cudnn7放在网盘
链接:https://pan.baidu.com/s/1kx-uhNSLukQmou1-Z6js-w
提取码:ka8r
其他版本上官网下载 https://developer.nvidia.com/cuda-toolkit-archive
安装cuda:双击cuda_9.0.176_win10.exe
点击精简安装就行,默认路径在:C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0
接下来解压cudnn-9.0-windows10-x64-v7,并把E:\Program Files\NVIDIA\cudnn-9.0-windows10-x64-v7\cuda\bin的cudnn64_7.dll文件拷贝一份到C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin
配置环境:
(1)把cudnn加入环境变量path
(2)配置CUDA环境
CUDA_PATH = C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0
CUDA_PATH_V9_0 = C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0
CUDA_SDK_PATH = C:\ProgramData\NVIDIA Corporation\CUDA Samples\v9.0
CUDA_LIB_PATH = %CUDA_PATH%\lib\x64
CUDA_BIN_PATH = %CUDA_PATH%\bin
CUDA_SDK_BIN_PATH = %CUDA_SDK_PATH%\bin\win64
CUDA_SDK_LIB_PATH = %CUDA_SDK_PATH%\common\lib\x64
pip install tensorflow-gpu==1.8 -i https://pypi.tuna.tsinghua.edu.cn/simple
安装1.8版本,-i https://pypi.tuna.tsinghua.edu.cn/simple表示使用清华镜像,下载速度比较快
测试是否安装成功,进入python环境后,import tensorflow as tf。如果没有出现错误表示安装成功,查看tensorflow版本命令:tf.__version__
备注:可能会出现
ImportError: DLL load failed: 找不到指定的程序。
解决方法:参考https://blog.csdn.net/lvsehaiyang1993/article/details/92805838