Darknet: Does the compiled .dll have to be in build/darknet/x64/

Created on 29 Jan 2019  ·  10Comments  ·  Source: AlexeyAB/darknet

I tried using darknet.py in my project but it gives

File "C:\Program Files\Python37\lib\ctypes\__init__.py", line 356, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found

I already changed the paths of winGPUdll and winNoGPUdll but it still gives the same error.

Solved question

Most helpful comment

@OndoyManing @bit-scientist

You should copy:
cudnn64_7.dll
cudart64_100.dll
cublas64_100.dll
curand64_100.dll

opencv_ffmpeg340_64.dll
opencv_world340.dll

pthreadGC2.dll
pthreadVC2.dll

And:

  • or darknet.sln -> Properties->C/C++->Code Generation->Runtime Library” , set its value to “Multi-threaded (/MT)”

All 10 comments

yolo_cpp_dll.dll have to be in build\darknet\x64\

yolo_cpp_dll.dll have to be in build\darknet\x64\

Hello, @AlexeyAB
Weird, It works on my PC but not on my laptop.
Here's what I did in my PC, I moved darknet.py, yolo_cpp_dll.dll, yolo_cpp_dll_nogpu.dll, to my project folder, I also changed the paths for yolo_cpp_dll.dll and yolo_cpp_dll_nogpu.dll in darknet.py and it works there.

So I copied my entire project folder and put it in my laptop in the hopes of running my project on the laptop but it gives me the error. I also made sure I made the changes in the paths in darknet.py

  File "C:/Users/marin/Desktop/darknet-master/build/darknet/x64/darknet.py", line 110, in <module>
    lib = CDLL(winGPUdll, RTLD_GLOBAL)
  File "C:\Program Files\Python37\lib\ctypes\__init__.py", line 356, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found

EDIT
I tried running darknet.py that is in build\darknet\x64\ in my laptop but it gives the same error. What could be the cause of this?

@OndoyManing did you copy dlls (if opencv = 3.4.0 -> opencv_ffmpeg340.dll, opencv_ffmpeg340_64.dll, opencv_world340.dll, opencv_world340d.dll ) of your used opencv and pthreadGC2.dll , pthreadVC2.dll next to _darknet.py_?

@OndoyManing did you copy dlls (if opencv = 3.4.0 -> opencv_ffmpeg340.dll, opencv_ffmpeg340_64.dll, opencv_world340.dll, opencv_world340d.dll ) of your used opencv and pthreadGC2.dll , pthreadVC2.dll next to _darknet.py_?

Hello, @bit-scientist ! Yes, I have them all in the same directory. Could it be due to the fact that MSVS and CUDA is not installed in the laptop, or it should still work as long as the mentioned .dlls are present?

@OndoyManing AFAIK, MSVS is not a must, as for CUDA, I am not sure it should be. Let's see what @AlexeyAB has to say.

@bit-scientist Thanks! I really hope I could get it up and running on the laptop because I couldn't take my PC with me wherever I go.

@OndoyManing @bit-scientist

You should copy:
cudnn64_7.dll
cudart64_100.dll
cublas64_100.dll
curand64_100.dll

opencv_ffmpeg340_64.dll
opencv_world340.dll

pthreadGC2.dll
pthreadVC2.dll

And:

  • or darknet.sln -> Properties->C/C++->Code Generation->Runtime Library” , set its value to “Multi-threaded (/MT)”

Hello, @AlexeyAB !
That definitely got rid of OSError: [WinError 126] The specified module could not be found.
I copied
cudnn64_7.dll
cudart64_100.dll
cublas64_100.dll
curand64_100.dll
vcruntime140.dll
msvcr100.dll
vcomp140.dll
msvcp140.dll

from my PC and pasted it in my laptop's project folder. The project now tries to load the cfg but stops due to this error:
CUDA Error: CUDA driver version is insufficient for CUDA runtime version
I could not install CUDA in my laptop because it only has an integrated GPU. Is there any way to get around this?

I really appreciate your work and thank you for taking the time reply!

@OndoyManing

I could not install CUDA in my laptop because it only has an integrated GPU. Is there any way to get around this?

What is your integrated GPU? You don't have nVidia GPU on your laptop at all?
Can you show output of the command? Rename it to the nvidia-smi.cmd nvidia-smi.cmd.txt

You you don't have nVidia GPU - then you can't use DLL that is compiled with CUDA.
Remove yolo_cpp_dll.dll
and copy only yolo_cpp_dll_nogpu.dll

What is your integrated GPU? You don't have nVidia GPU on your laptop at all?

Unfortunately, this one doesn't have a dedicated GPU. It only has an intel HD something.

The good news is, it's finally working! I removed yolo_cpp_dll.dll from the project folder and voila!
Thank you so much for guiding me all the way through!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

PROGRAMMINGENGINEER-NIKI picture PROGRAMMINGENGINEER-NIKI  ·  3Comments

yongcong1415 picture yongcong1415  ·  3Comments

Jacky3213 picture Jacky3213  ·  3Comments

bit-scientist picture bit-scientist  ·  3Comments

Cipusha picture Cipusha  ·  3Comments