caffe-windows icon indicating copy to clipboard operation
caffe-windows copied to clipboard

Error in import caffe

Open XuSen123 opened this issue 7 years ago • 10 comments

I followed the instructions. And compile both libcaffe and pycaffe thes two projects successful. And After I copy pycaffe/caffe into ../Lib/site-packages/ and import caffe in cmd. It says: from ._caffe import Net, SGDSolver, NesterovSolver, AdaGraSolver, \ ImportError: DLL load failed, %1 not win32 application.

I use windows10, Anaconda 4.4.0(64bit python27) and all of caffe projects were successfully builded in win64.

XuSen123 avatar Nov 13 '17 18:11 XuSen123

I'm having a similar problem. Compiles just fine and there's no errors as far as I can tell. After copying it into my site-packages and trying to run it as import, I get: File "C:\Users\Eric\Anaconda2\lib\site-packages\caffe\pycaffe.py", line 13, in from ._caffe import Net, SGDSolver, NesterovSolver, AdaGradSolver,
ImportError: DLL load failed: The specified module could not be found.

EricEidel avatar Nov 14 '17 16:11 EricEidel

I download caffe-windows(ms branch) again and follow the instruction and successfully import caffe.

XuSen123 avatar Nov 27 '17 07:11 XuSen123

@EricEidel How could you solve this problem? I also meet this strange problem, previously everything is ok but when i add a new layer and everything is ok when compililng.... But when I import caffe.... It informs that the exactly same error. I am just wondering where can I get more error information?

PkuRainBow avatar Dec 02 '17 06:12 PkuRainBow

Hey @PkuRainBow, I ended up forking a different repo for the caffe framework for windows. I used https://github.com/Microsoft/caffe and followed their instructions on the page and the error went away. I was able to build and copy the caffe folder into my python folder to run the programs I wanted.

EricEidel avatar Dec 02 '17 06:12 EricEidel

@EricEidel I solved the problem. I recommend a software named DependencyWalker, which can analyze the missing dll files quickly.

PkuRainBow avatar Dec 02 '17 07:12 PkuRainBow

update : oh, I solved my problem. When I run caffe.exe , found that missing cudnn64_5.dll. copy cudnn64_5.dll to caffe folder , I successfully import caffe.

hey @PkuRainBow, How could you solve this problem? I tried to use DependencyWalker, but this software can only view the DLL file. the folder where I compiled.

souldong1591 avatar Dec 30 '17 08:12 souldong1591

I solved the problem after copy cudnn64_7.dll and \windows\thirdparty\bins*.dll to Anaconda3\Library\bin

senlinuc avatar Feb 18 '18 04:02 senlinuc

@XuSen123 @EricEidel @PkuRainBow @souldong1591 @senlinuc @happynear,I followed the instructions. And compile both libcaffe and pycaffe thes two projects successful. And After I copy pycaffe/caffe into ../Lib/site-packages/ and import caffe in cmd.I get this result. imgI try to copy cudnn64_5.dll and \windows\thirdparty\bins*.dll to Anaconda2\Library\bin and restart the computer. At the same time, I add the 'F:\caffe_windows_new\caffe-windows-ms\caffe-windows-ms\windows\thirdparty\bins' to the system path. I also have this question. I will appreciated if I received your reply as soon as possible. Thank you very much!

SYSTEM CONFIGURE: Win10, VS1025, Anaconda2

18191171661 avatar Apr 05 '18 07:04 18191171661

@souldong1591 copy dlls to pycaffe\caffe folder

maxteleg avatar Apr 09 '18 05:04 maxteleg

Ok,Thank you very much! I will try it as soon as possible.In fact, I solve it throught other methods. Thanks for you replay again。

18191171661 avatar Apr 09 '18 07:04 18191171661