之前也装过很多遍了,记录下来以后就不用到处找了。
安装
tensorflow的gpu版:
1.查看GPU型号,寻找对应的cuda
2.下载并安装:
3.配置环境:
(1)CUDA_BIN_PATH
%CUDA_PATH%\bin
(2)CUDA_LIB_PATH
%CUDA_PATH%\lib\x64
(3)CUDA_SDK_PATH
C:\ProgramData\NVIDIA Corporation\CUDA Samples\v10.0
(4)CUDA_SDK_BIN_PATH
%CUDA_SDK_PATH%\bin\win64
(5)CUDA_SDK_LIB_PATH
%CUDA_SDK_PATH%\common\lib\x64
系统变量path中添加四个变量值
%CUDA_LIB_PATH%
%CUDA_BIN_PATH%
%CUDA_SDK_BIN_PATH%
%CUDA_SDK_LIB_PATH%
4.下载cuDNN
查看对应版本及下载:
https://developer.nvidia.com/rdp/cudnn-archive
把下载后的压缩文件解压缩,分别将cuda/include、cuda/lib、cuda/bin三个目录中的内容拷贝到C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0对应的include、lib、bin目录下即可完成安装。
出现的问题汇总:
-
1.ImportError: DLL load failed: 找不到指定的模块。
这一般是tensorflow-gpu的版本问题,我之前安装的是1.12.0版本出现该问题,换成 1.10.0问题解决,输入pip install --upgrade tensorflow-gpu==1.10.0。 -
2.ImportError: Could not find ‘msvcp140.dll’.
ImportError: Could not find ‘msvcp140.dll’. TensorFlow requires that this DLL be installed in a directory that is named in your %PATH% environment variable. You may install this DLL by downloading Visual C++ 2015 Redistributable Update 3 from this URL: https://www.microsoft.com/en-us/download/details.aspx?id=53587
打开提示的URL:https://www.microsoft.com/en-us/download/details.aspx?id=53587
下载安装,问题解决