Home > database >  Could not locate zlibwapi.dll. Please make sure it is in your library path
Could not locate zlibwapi.dll. Please make sure it is in your library path

Time:05-26

I am working on a object detection project and wanting to process the project with my GPU. I have completed the NVIDIA setup tutorial and everything works fine. My object detection code originally works with the CPU, however when I add these two lines of code:

net.setPreferableBackend(cv2.dnn.DNN_BACKEND_CUDA)
net.setPreferableTarget(cv2.dnn.DNN_TARGET_CUDA)

the output displayed:

Could not locate zlibwapi.dll. Please make sure it is in your library path!

I have downloaded the zlibwapi.dll zip file stated from the cuDNN website, unzip and added the whole folder into my environment variables paths. The folder is called "zlib123dllx64" containing a "dll_x64" folder and a "static_x64" folder. The "zlibwapi.dll" is inside the "dll_x64" folder. I have added the "zlib123dllx64" folder in the user and system path variable but it doesn't seem to fix any of the problems. How can I fix this error and make the GPU work with the code?

My environment setup:

  • Windows 10
  • Visual studio community 2019
  • OpenCV Python yolov3

CodePudding user response:

If anyone also got the same problem as me, I managed to fix the problem. Instead of calling the whole "zlib123dllx64" folder into the system environment path, you simply just add the "zlibwapi.dll" inside the "dllx64" folder into your project folder and include it in your project. This fixed my problem. cheers

  • Related