-
Notifications
You must be signed in to change notification settings - Fork 18.6k
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 can't import _caffe module #263
Comments
Make sure you have done
and that you have copied the caffe/python/caffe dir into your |
Hi, Thanks very much for your reply Evan! I had trouble finding the makefile for pycaffe, the caffe dir is in my On Thu, Mar 27, 2014 at 1:57 AM, Evan Shelhamer notifications@github.comwrote:
|
Please take another look at the compilation section of the installation guide, above all the parts about Good luck. |
Maybe #256 will help. |
I have done make all my PYTHONPATH looks like this: /.../caffe_temp/python/caffe:/usr/lib64/python2.6:/.../caffe_temp/distribute/python:/usr/lib64/python2.6/site-packages:/.../caffe_temp/python I have the _caffe.so module under caffe/python/caffe, but when I run python pycaffe.py I still get the error Traceback (most recent call last): Thanks! |
|
Please inspect your
|
I created a new directory under home folder and it worked fine, thanks! Out of curiosity, I wasn't able to find any documentation in terms of how to view the top prediction results for cifar10. Would there be any implementation in caffe that would show the prediction? |
Closing with resolution of the pycaffe issue. For the network output question, see #281 (comment). |
Hello, I had the same (or similar) problem!
I successfully did: I also added python/caffe & distribute/python/caffe to my PYTHONPATH. Could someone please help with this issue? |
@dkkim930122, I believe you should have |
@longjon
I tried: export LD_LIBRARY_PATH=/opt/intel/mkl/lib/intel64:/usr/local/cuda/lib64 |
I am experiencing the same problem when trying to install scipy, even though /opt/intel/mkl/lib/intel64 is in LD_LIBRARY_PATH. |
try |
Has anyone found a solution to this problem? I am also getting same kind of error as this
my $PYTHONPATH is set to following |
I have same problem I have done: It works, but I dont know why after restart computer Traceback (most recent call last): have checked command |
When I try to make pycaffe, files like _caffe.cpp and _caffe.hpp; have #include "caffe/caffe.hpp" ... The error seems to occur due to unavailability of this module ... Does anyone knows the solution?? Thnks in advance |
@shelhamer, thanks i solved no module named caffe problem :) |
I am get the similiar error, but I don't know how to set the PATHONPATH . How to do ? |
I am also facing a similar problem. I tried doing all of this. I am getting the following error: ImportError: dlopen(caffe/_caffe.so, 2): Library not loaded: @rpath/libcaffe.so make all All work fine ... What am I doing wrong? |
And if I give the caffe module path as caffe/python instead of the one in distribute/python Process: Python [6445] Date/Time: 2015-04-25 20:21:57.900 +0530 Time Awake Since Boot: 3300 seconds Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_BAD_ACCESS (SIGSEGV) |
@longjon |
I got the same error as "No module name caffe" and set as @longjon said,also meet error as "ImportError:libcaffe.so: cannot open shared object file:no such file or directory", finally, I do as "http://nbviewer.ipython.org/github/BVLC/caffe/blob/master/examples/classification.ipynb" did and it is solved |
did you install caffe rigth? 2015-06-12 10:23 GMT+08:00 luweishuang notifications@github.com:
|
@luweishuang That link is expired and I'm having the same issue. Can you describe what you did? |
Same issue here, anyone could solve it? |
I have a similar issue - I did cmake (flags) .. using the cmake procedure and generated _caffe.so, then did an export PYTHONPATH to the right directory (........../caffe/python), but Python (IDLE or IPython) doesn't recognize it. I get the "no module named _caffe" (not "no module named caffe") error. |
From your code it seems that you didn't try to change "from .pycaffe import ..." to "from caffe.pycaffe import ..." within the init script. |
@ShaharKatz I have a similar problem and I tried changing "from .pycaffe import" to "from caffe.pycaffe import" and it still doesn't work for me. Can you help me out? Thanks! |
I fixed the problem for me by doing the following (Windows 8.1 with cuda 7.5):
this is due to the fact that python pulls the python wrapper dll which is Cheers, Timos |
In my case, I couldn't use caffe with openCV. When I tried to import caffe on python, it worked. However, If I tried to import caffe with cv2, it returned error like below. [libprotobuf ERROR google/protobuf/descriptor_database.cc:57] File already exists in database: caffe.proto I searched how can I fix these error on the internet. And I followed some answers. |
Seems this helps: |
@mrgloom |
Everything built successfully. I even set path in bashrc, but still getting "NO module named caffe" error. |
i got the same error! anyone has solved this please give us the point. i compiled and set path correctly but still it give me no caffe module found |
I fixed my problem! 👍
do not forget to update PYTHONPATH environment variable!!
|
I have same problem but I solved it in another way and like to share with you, |
http://installing-caffe-the-right-way.wikidot.com/start |
it worked for me. But it shows another errors :( |
lastly "source ~/.bashrc" or "source /etc/profile". |
Maybe you need to source ~/.bashrc, close the terminal and reopen. Or even make pycaffe again. Make sure you have _caffe.so in the /python/caffe. |
Hello everyboby
Please anybody can help me to fixe it .....thanks |
@Abdoulzen Hi may i know how did you fix it? |
@WUhailing i just created a new environmet for python2.7 and follow this https://www.youtube.com/watch?v=DnIs4DRjNL4&t=1315s |
Thanks @Abdoulzen,I found out that cmake causes this ImportError in python 3, so switch to make and it works damn well. |
ok @WUhailing now i'm getting the same errors. Want to know how you fixed it |
@shelhamer I can't find my caffe folder anymore |
In my case, the python path was a relative path after I changed to absolute path such as: /User/home/project/caffe/python it started working. So the point is use "Absolute" path. |
I face the same problems.When I had down all the steps, I
the same problems happened
NICE!!!!! |
Hello,I make caffe with cmake, and someone says that pycaffe interface has been made with cmake. However when I import caffe I got the error (No module named _caffe),and I had set the path . |
Hai, Faced the same issue, while importing Caffe after installing Caffe in windows with GPU, could fix it by copying Hope this will help, all the best..! |
I suspect this is some stupid set-up problem that I make since no one else seems to have trouble running it..
So I was trying to run the pre-trained network by following the instruction, when I tried to run the following command:
python ../python/caffe/detection/detector.py --crop_mode=selective_search --pretrained_model=../examples/imagenet/caffe_reference_imagenet_model --model_def=../examples/imagenet/imagenet_deploy.prototxt _temp/cat.txt _temp/cat.h5
I got an error saying:
It seems like python is not recognizing the _caffe.cpp file...Would anyone know how to solve this problem?
Thanks tons!
The text was updated successfully, but these errors were encountered: