[英]OSError: [WinError 126] module could not be found
I am trying to run MXNet port of SSD in python but I am facing a strange error when I run the demo saying 我正在尝试在python中运行SSD的MXNet端口,但是在运行演示时遇到了一个奇怪的错误
OSError: [WinError 126] The specified module could not be found
specifically when trying to open libmxnet.dll
so I found when I tried to debug it. 特别是在尝试打开
libmxnet.dll
因此我在尝试调试它时发现了它。
the whole error message is like this: 整个错误消息是这样的:
>>>> kernel32
>>>> C:\Users\wisdom\Anaconda3\envs\gpu-test\lib\site-packages\mxnet\libmxnet.dll
Traceback (most recent call last):
File "demo.py", line 2, in <module>
import tools.find_mxnet
File "C:\Users\wisdom\Desktop\mxnet-ssd-master\tools\find_mxnet.py", line 6, in <module>
import mxnet as mx
File "C:\Users\wisdom\Anaconda3\envs\gpu-test\lib\site-packages\mxnet\__init__.py", line 24, in <module>
from .context import Context, current_context, cpu, gpu, cpu_pinned
File "C:\Users\wisdom\Anaconda3\envs\gpu-test\lib\site-packages\mxnet\context.py", line 24, in <module>
from .base import classproperty, with_metaclass, _MXClassPropertyMetaClass
File "C:\Users\wisdom\Anaconda3\envs\gpu-test\lib\site-packages\mxnet\base.py", line 213, in <module>
_LIB = _load_lib()
File "C:\Users\wisdom\Anaconda3\envs\gpu-test\lib\site-packages\mxnet\base.py", line 204, in _load_lib
lib = ctypes.CDLL(lib_path[0], ctypes.RTLD_LOCAL)
File "C:\Users\wisdom\Anaconda3\envs\gpu-test\lib\ctypes\__init__.py", line 353, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found
where first two lines with >>>> sign indicate to the lines I was trying to debug and check where/when the error is fired in ...\\ctypes\\__init__.py
file which look like this 其中带有>>>>符号的前两行表示我正在尝试调试的行,并检查在
...\\ctypes\\__init__.py
文件中...\\ctypes\\__init__.py
错误的位置/时间,如下所示
if handle is None:
x = (self._name)
print('>>>>',x)
self._handle = _dlopen(self._name, mode)
I checked of course the existence of the requested file libmxnet.dll
and it is there, but whenever it is called it throws this error! 我当然检查了所请求文件
libmxnet.dll
存在,并且在那里,但是无论何时调用它,都会引发此错误!
Ok finally solved! 好,终于解决了!
I got to know that such error could be thrown when the file dependencies are not satisfied or not found. 我知道当不满足或找不到文件依赖项时,可能会引发此类错误。 So to check the dependencies you go first to Visual Studio Prompt and then navigate to the folder where
libmxnet.dll
exists and run the following command 因此,要检查依赖项,您首先要进入Visual Studio Prompt,然后导航到
libmxnet.dll
存在的文件夹并运行以下命令
dumpbin /dependents libmxnet.dll
and it will show you a list of required files. 它将显示所需文件列表。
What was missing in my case are some of nVidia GPU Computing Toolkit
files Cuda 9.0
as libmxnet.dll
asks for them and I was having toolkit version 10.0 instead! 在我的情况下,缺少的是
nVidia GPU Computing Toolkit
文件Cuda 9.0
因为libmxnet.dll
要求提供这些文件,而我使用的是工具箱版本10.0!
您应该安装vcredist_x64或vcredist_x86软件包代表Visual C ++ Redistributable。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.