【发布时间】:2021-04-07 23:49:43
【问题描述】:
要让tensorflow-gpu 2.x Python 包在带有 NVidia GPU 的 Windows 上运行的步骤是什么?
即我怎样才能摆脱Could not find 'cudart64_101.dll' 然后Could not find 'cudnn64_7.dll'?
【问题讨论】:
标签: python windows tensorflow tensorflow2.0 nvidia
要让tensorflow-gpu 2.x Python 包在带有 NVidia GPU 的 Windows 上运行的步骤是什么?
即我怎样才能摆脱Could not find 'cudart64_101.dll' 然后Could not find 'cudnn64_7.dll'?
【问题讨论】:
标签: python windows tensorflow tensorflow2.0 nvidia
https://www.nvidia.com/Download/index.aspx
pip uninstall tensorflow
pip install tensorflow-gpu
(*) 对于较新的版本,tensorflow 和 tensorflow-gpu 是同一个包,所以只需更新 tensorflow 使用:
pip install --upgrade tensforflow
首先以下测试会失败,请注意丢失文件的版本,例如Could not find 'cudart64_101.dll'
import tensorflow
tensorflow.test.is_built_with_gpu_support() # Test install of pip package, should output True
tensorflow.test.is_gpu_available() # Should output True
tensorflow.test.gpu_device_name() # Should output something like /device:GPU:0
选择自定义设置并:
CUDA / Visual Studio Integration
Driver components
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin;
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\libnvvp;
会失败,请注意丢失文件的版本,例如Could not find 'cudnn64_7.dll'
https://developer.nvidia.com/rdp/cudnn-archive
cuda文件夹的内容解压并复制到:C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\(或您下载安装的版本)【讨论】: