繁体   English   中英

在 tensorflow v.1.15 sess=tf.Session() 上 - 无法加载动态库“cudnn64_7.dll”; dlerror: cudnn64_7.dll 未找到

[英]On tensorflow v.1.15 sess=tf.Session() - Could not load dynamic library 'cudnn64_7.dll'; dlerror: cudnn64_7.dll not found

我将 tensorflow v.2.0 降级到 v.1.15 然后我在 ipython 中输入了一些代码进行检查。 但是,关于 cudnn64_7.dll 存在一些问题

(base) C:\Users\puppy>ipython
Python 3.7.4 (default, Aug  9 2019, 18:34:13) [MSC v.1915 64 bit (AMD64)]
Type 'copyright', 'credits' or 'license' for more information
IPython 7.8.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import tensorflow as tf
2019-10-31 00:14:52.841679: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully         opened dynamic library cudart64_100.dll

In [2]: hello=tf.constant('Hello, tensorflow!')

In [3]: sess=tf.Session()
2019-10-31 00:17:45.140209: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully     opened dynamic library nvcuda.dll
2019-10-31 00:17:45.937511: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1618] Found device 0 with     properties:
name: GeForce 920M major: 3 minor: 5 memoryClockRate(GHz): 0.954
pciBusID: 0000:03:00.0
2019-10-31 00:17:45.945256: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully     opened dynamic library cudart64_100.dll
2019-10-31 00:17:45.981463: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully     opened dynamic library cublas64_100.dll
2019-10-31 00:17:46.039438: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully     opened dynamic library cufft64_100.dll
2019-10-31 00:17:46.056982: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully     opened dynamic library curand64_100.dll
2019-10-31 00:17:46.131993: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully     opened dynamic library cusolver64_100.dll
2019-10-31 00:17:46.192560: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusparse64_100.dll
2019-10-31 00:17:46.202156: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load     dynamic library 'cudnn64_7.dll'; dlerror: cudnn64_7.dll not found
2019-10-31 00:17:46.209181: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1641] Cannot dlopen some GPU         libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the     required libraries for your platform.
Skipping registering GPU devices...
2019-10-31 00:17:46.223313: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports     instructions that this TensorFlow binary was not compiled to use: AVX2
2019-10-31 00:17:46.237318: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1159] Device interconnect     StreamExecutor with strength 1 edge matrix:
2019-10-31 00:17:46.243341: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1165]

In [4]: print(sess.run(hello))
b'Hello, tensorflow!'

这部分是问题

2019-10-31 00:17:46.202156: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load     dynamic library 'cudnn64_7.dll'; dlerror: cudnn64_7.dll not found
2019-10-31 00:17:46.209181: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1641] Cannot dlopen some GPU         libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the     required libraries for your platform.
Skipping registering GPU devices...
2019-10-31 00:17:46.223313: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports     instructions that this TensorFlow binary was not compiled to use: AVX2
2019-10-31 00:17:46.237318: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1159] Device interconnect     StreamExecutor with strength 1 edge matrix:

为什么我找不到 cudnn64_7.dll? 我下载“cuDNN v7.6.4(2019 年 9 月 27 日),用于 CUDA 10.0”并像这样添加到系统变量的路径中

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\bin
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\libnvvp
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\bin\dll
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\extras\CUPTI\libx64

如何解决此问题并使用 GPU 库?

有时会发生 cudnn64_7.dll 自动从 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0.0 中删除。 尝试从提取的 cudnn package 中重新粘贴文件,它将起作用。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM