我在Windows(发行版,x64)上建立了_caffe.cpp的.dll.
我将扩展名.dll更改为.pyd,并尝试将其导入python中:
import caffe
File "\caffe-master\python\caffe\__init__.py", line 1, in <module>
from .pycaffe import Net, SGDSolver
File "\caffe-master\python\caffe\pycaffe.py", line 13, in <module>
from ._caffe import Net, SGDSolver
ImportError: DLL load failed: The specified module could not be found.
这是什么意思,缺少一些依赖模块,该模块包含在Visual Studio项目中(我在其中构建此dll)?
解决方法:
您需要将Python Caffe添加到PYTHONPATH.例如:
导出PYTHONPATH = $PYTHONPATH:/ home / username / caffe / python