Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python wrapper problem #3

Closed
alitou opened this issue May 29, 2015 · 7 comments
Closed

Python wrapper problem #3

alitou opened this issue May 29, 2015 · 7 comments

Comments

@alitou
Copy link

alitou commented May 29, 2015

I compile python wrapper for caffe successfully but when I want to import caffe I got into this error.
Traceback (most recent call last):
File "", line 1, in
File "caffe__init__.py", line 1, in
from .pycaffe import Net, SGDSolver
File "caffe\pycaffe.py", line 10, in
from ._caffe import Net, SGDSolver
ImportError: DLL load failed: The specified module could not be found.
How can I make it work?
Thanks

@happynear
Copy link
Owner

I guess you haven't add ./3rdparty/bin folder to your 'PATH' environment variable and restart your computer.
To check if you successfully add the path, you should firstly run ./bin/mainbuilder.exe without errors.

@alitou
Copy link
Author

alitou commented May 29, 2015

MainCaller.exe works without errors.I add the bin folder to PATH.But still have the problem.When I want to import caffe I got the error "No module named caffe", then I managed to use this:
caffe_root = '../(my caffe root)' # this file is expected to be in {caffe_root}/examples
import sys
sys.path.insert(0, caffe_root + 'python')
and I got the above error.

@happynear
Copy link
Owner

Notice that _caffe.pyd is generated to ./python/caffe. After you have add caffe_root + 'python' to sys.path. To import caffe module, you should run:

import caffe._caffe

or

from caffe import _caffe

@alitou
Copy link
Author

alitou commented May 30, 2015

Yes it is generated at the path.Still get the same error on importing Net and SGDsolver.

@alitou
Copy link
Author

alitou commented May 30, 2015

I used your new 3rdparty dependencies and Now I get the error on import caffe.imagenet:
No module named imagenet

@happynear
Copy link
Owner

It seems that there is no init.py in imagenet folder. Just create a empty one.

@ghost
Copy link

ghost commented Jun 7, 2016

Hi all,
I have the same problem. Did it get resolved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants