终于完成tensorflow-gpu的下载与成功使用,在此记录一下下载过程及下载过程中遇到的问题和解决方法
开始只安装了tensorflow 1.12.0,也不太清楚cpu、gpu等内容,然后运行github上下载的程序,报错如下:
报错:tensorflow.python.framework.errors_impl.InternalError: cudaGetDevice() failed.
Status: CUDA driver version is insufficient for CUDA runtime version上网查看后说是CUDA等的版本问题,然后一步一步下载……
各种包、驱动等的版本号为:
OS: win10
Anoconda Python 3.6.0
VS 2015
CUDA 8.0.61
cudnn-8.0-windows10-x64-v7.1-ga.zip(已改为cudnn-7.5-windows10-x64-v6.0.zip)
tensorflow 1.4.0
- Anoconda Python 3.6.0
之前电脑中已安装,官网下载即可
- VS 2015
官网下载
用该驱动打开 VS 2015的iso文件:
参考链接:
https://blog.csdn.net/guxiaonuan/article/details/73775519
- CUDA 8.0.61
官网下载
注意事项:以管理员身份运行,精简安装(推荐)即可- cudnn-8.0-windows10-x64-v7.1-ga.zip
官网下载对应版本
需要注册并填问卷,下载后解压压缩包,将包内文件夹里面的内容分别拷贝到
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0里面的三个文件夹中去。
参考链接:
https://blog.csdn.net/asd136912/article/details/79383161#commentBox
后面应用的时候遇到一个问题:(如没有遇到可忽略)
ImportError: Could not find ‘cudnn64_6.dll’. TensorFlow requires that this DLL be installed in a directory that is named in your %PATH% environment variable. Note that installing cuDNN is a separate step from installing CUDA, and this DLL is often found in a different directory from the CUDA DLLs. You may install the necessary DLL by downloading cuDNN 6 from this URL: https://developer.nvidia.com/cudnn
解决方法:
如果你没有 cudnn64_6.dll, 可以使用如下方法:
在
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin文件夹中将 cudnn64_7.dll 或 cudnn64_8.dll 重命名为 cudnn64_6.dll补充:(后续使用中)由于报错(如文章末尾描述),后修改为:(修改版本后替换原来的三个文件)
- tensorflow 1.4.0
如果之前装了cpu版本,也可以直接装gpu版本
命令为:pip install tensorflow-gpu==1.4.0查看tensorflow版本
其他参考链接:(参考了很多,有些忘记地址啦)
https://blog.csdn.net/asd136912/article/details/79383161#commentBox
https://blog.csdn.net/Kevin_HZH/article/details/81876527实际运行中遇到问题:
Loaded runtime CuDNN library: 7104 (compatibility version 7100) but source was compiled with 6021 (compatibility version 6000)
解决为:将cudnn版本由7.1改为了6.0
参考链接:
https://github.com/keras-team/keras/issues/9567
本博客所有文章除特别声明外,均采用 CC BY-SA 3.0协议 。转载请注明出处!