web-dev-qa-db-ja.com

Tensorflow v.1.15 SESS = TF.Session() - 動的ライブラリ 'cudnn64_7.dll'をロードできませんでした。 dlerror:cudnn64_7.dllが見つかりません

私は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が見つからない理由私はCUDA 10.0 'のための' CUDNN v7.6.4(2019年9月27日)をダウンロードし、このようなシステム変数の道に追加されました

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ライブラリを使用するにはどうすればいいですか?

4
김태현

CUDNN64_7.DLLがC:\ Program Files\Nvidia GPU Computing Toolkit\CUDA\v10.0\binから自動的に削除されることが時々起こることがあります。抽出されたCUDNNパッケージからファイルを再貼り付けてみてください。

2
Debjit Datta