记录一下重新安装tensorflow-gpu及遇到的问题(win10系统)
安装成功对应的版本tensorf-gpu 1.15,keras 2.3,cuda_10.0.130_411.31_win10,cudnn-10.0-windows10-x64-v7.4.2.24
安装tensorflow的源:pip install -i https://pypi.doubanio.com/simple/ tensorflow-gpu==1.15
这里有个问题就是cuda10.0有多个版本,对应的cudnn对应cuda10.0也有多个版本(时间不同),不确定时间是否也要一一对应,还是可以向前兼容。
遇到Could not load dynamic library ‘cudart64_101.dll’的报错,可单独下载对应的dll文件放在C:\windows\system32\路径下,重启后才可用
安装CUDA正常下一步即可,安装成功后将对应版本的cuda文件夹解压到自定义位置,在环境变量的Path中添加路径。
“no kernel image is available for execution on the device”问题,显卡算例不符合cuda的要求
可使用如下命令测试gpu是否可用:
import tensorflow as tf
a = tf.test.is_built_with_cuda() # 判断CUDA是否可以用
b = tf.test.is_gpu_available( cuda_only=False, min_cuda_compute_capability=None ) # 判断GPU是否可以用
返回结果
CUDA下载: https://developer.nvidia.com/cuda-toolkit-archive
win + R:dxdiag查看显存大小
查看GPU信息:进入C:\Program Files\NVIDIA Corporation\NVSMI使用nvidia-smi命令