title: Could not locate zlibwapi.dll. Please make sure it is in your library path
body: <p>I am working on a object detection project and wanting to process the project with my GPU. I have completed the <a href="https://medium.com/analytics-vidhya/build-opencv-from-source-with-cuda-for-gpu-access-on-windows-5cd0ce2b9b37" rel="nofollow noreferrer">NVIDIA setup tutorial</a> and everything works fine. My object detection code originally works with the CPU, however when I add these two lines of code:</p>
  <pre><code>net.setPreferableBackend(cv2.dnn.DNN_BACKEND_CUDA)
  net.setPreferableTarget(cv2.dnn.DNN_TARGET_CUDA)
  </code></pre>
  <p>the output displayed:</p>
  <blockquote>
  <p>Could not locate zlibwapi.dll. Please make sure it is in your library path!</p>
  </blockquote>
  <p>I have downloaded the zlibwapi.dll zip file stated from the <a href="https://docs.nvidia.com/deeplearning/cudnn/install-guide/index.html" rel="nofollow noreferrer">cuDNN website</a>, unzip and added the whole folder into my environment variables paths. The folder is called &quot;zlib123dllx64&quot; containing a &quot;dll_x64&quot; folder and a &quot;static_x64&quot; folder. The &quot;zlibwapi.dll&quot; is inside the &quot;dll_x64&quot; folder. I have added the &quot;zlib123dllx64&quot; 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?</p>
  <p>My environment setup:</p>
  <ul>
  <li>Windows 10</li>
  <li>Visual studio community 2019</li>
  <li>OpenCV Python yolov3</li>
  </ul>