我非常接近使用keras / tensorflow python库配置启用gpu的环境。当我尝试训练我的模型时,我收到一条很长的错误消息:
2018-11-27 18:34:47.776387: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1511] Adding visible gpu devices: 0
2018-11-27 18:34:48.769258: I tensorflow/core/common_runtime/gpu/gpu_device.cc:982] Device interconnect StreamExecutor with strength 1 edge matrix:
2018-11-27 18:34:48.769471: I tensorflow/core/common_runtime/gpu/gpu_device.cc:988] 0
2018-11-27 18:34:48.769595: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1001] 0: N
2018-11-27 18:34:48.769825: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 3024 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1050, pci bus id: 0000:01:00.0, compute capability: 6.1)
2018-11-27 18:34:50.405201: E tensorflow/stream_executor/cuda/cuda_dnn.cc:363] Loaded runtime CuDNN library: 7.1.4 but source was compiled with: 7.2.1. CuDNN library major and minor version needs to match or have higher minor version in case of CuDNN 7.0 or later version. If using a binary install, upgrade your CuDNN library. If building from sources, make sure the library loaded at runtime is compatible with the version specified during compile configuration.
我看过几个类似的堆栈溢出文章,看来我需要调整CuDNN版本或tensorflow-gpu版本。我从Nvidia的网站下载了正确版本的CuDNN,但它似乎没有任何作用。我还找到了一些有关更改tensorflow-gpu版本的帖子,但是我应该下载和下载WHICH版本。我正在使用Windows 10。
答案 0 :(得分:0)
嗨,这个powershell脚本应该可以更新您的驱动程序。
$ur='https://dsvmteststore.blob.core.windows.net/patches/cuda/cudnnpatch.zip?st=2019-02-20T04%3A10%3A00Z&se=2019-03-01T04%3A10%3A00Z&sp=r&sv=2017-07-29&sr=c&sig=w1VqK70ZcWWbbRW2K4Y8q5298dNxBqsoP71%2F4nF6uYM%3D'
Invoke-WebRequest -Uri $ur -OutFile '.\cudnnpatch.zip' -UseBasicParsing
$from='.\cudnnpatch.zip'
$to='.\'
cmd /c "c:\7-Zip\7z.exe x $from -o$to -y"
$root='C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0'
$dll='\bin\cudnn64_7.dll'
$header='\include\cudnn.h'
$lib='\lib\x64\cudnn.lib'
$from='.\cuda'
Copy-Item "$from$dll" "$root$dll" -Force
Copy-Item "$from$header" "$root$header" -Force
Copy-Item "$from$lib" "$root$lib" -Force