Table of contents
Possibility 2: cudnn is not installed
Possibility 3: zlibwapi is not installed (solve the root cause of the problem!) Refer here
Problem Description:
When running tf.keras/model.fit in jupyter notebook, the error Loaded cuDNN version 8400 Could not load library cudnn_cnn_infer64_8.dll is reported in the jupyter terminal.
Possibility 1:The versions of cuda and cudnn are wrong, but my cuda11.6, cudnn8.4.0, and tensorflow2.8.0 versions match, rule out this possibility
Possibility 2: cudnn is not installed
So re-decompress the downloaded cudnn8.4.0, name the original folder "cudnn-windows-x86_64-8.4.0.27_cuda11.6-archive" as cudnn, and copy the named cudnn directly to the installed CUDA Directory 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6'.
and re-insystem variablesenvironment variables Add the following three new paths to path:
- C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\cudnn\include
- C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\cudnn\lib
- C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\cudnn\bin
The problem has not been solved at this step, but cudnn has been installed at this time.Exclude the possibility that cudnn has not been installed
Possibility 3: Not installedzlibwapi (solve the root cause of the problem!)Refer here
A mistake here: I read the wrong tutorial and mistakenly downloaded the 32-bit version on the right. I also copied it to C:\Windows\System32 and added the corresponding path, but it didn’t work.
You should click on the red box on the left to download.
- Unzip the downloaded installation package and add the three files inside to the folder named "zlib123dllx64"
- And move the zlib123dllx64 folder into the C:\Program Files (x86) path and set this path in path
Restart jupyter and run
As shown in the figure, it is displayed in the jupyter terminal
I tensorflow/core/common_runtime/gpu/gpu_device.cc:1525] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 3991 MB memory: -> device: 0, name: NVIDIA GeForce GTX 1660 Ti, pci bus id: 0000:01:00.0, compute capability: 7.5
Loaded cuDNN version 8400
Indicates that the gpu is running