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

ImportError: No module named caffe.layers.detectnet.clustering #1181

Closed
szm-R opened this issue Oct 18, 2016 · 8 comments
Closed

ImportError: No module named caffe.layers.detectnet.clustering #1181

szm-R opened this issue Oct 18, 2016 · 8 comments
Labels

Comments

@szm-R
Copy link

szm-R commented Oct 18, 2016

Hi everyone,

As the title suggests I'm getting the following error when I try to run my inference code for detectnet:
ImportError: No module named caffe.layers.detectnet.clustering
terminate called after throwing an instance of 'boost::python::error_already_set'

The error resolves when I copy the exe file to caffe root and execute it there, but remains otherwise.
I have added caffe_root/python to my PYTHONPATH and PATH and running the command:
python -c "import caffe; print caffe.file"
gives me this path:
/home/gpuserver/Moosavi/DIGITS/nv-caffe/python/caffe/init.pyc

which is the right one.

I'm using nvidia caffe version 0.15.13, and the inference code is written in cpp.

@lukeyeager
Copy link
Member

Can you post the actual log of the error?

Also, just a thought, is the entry in your PYTHONPATH that contains caffe relative or absolute?

@szm-R
Copy link
Author

szm-R commented Oct 19, 2016

sorry but I don't know what you mean by actual log of error, when I run the code it only gives me the two lines I said and then the program crashes.
I have added caffe to my PYTHONPATH by adding the following line to ~/.bashrc:

 export PYTHONPATH="${PYTHONPATH}:/home/gpuserver/Moosavi/DIGITS/nv-caffe/python

(if that's what you mean)

@lukeyeager
Copy link
Member

As an example:

$ ls /not-a-directory
ls: cannot access '/not-a-directory': No such file or directory

@szm-R
Copy link
Author

szm-R commented Oct 19, 2016

I'm sorry but I don't understand what this has to do with my question :(

@lukeyeager
Copy link
Member

Please just post the command you tried to run, and the output that you got (including the error message).

@szm-R
Copy link
Author

szm-R commented Oct 19, 2016

OK, I think the problem is with my IDE,
This is what I'm doing:

I write the code in Qt and compile it, when I run it there (by pushing the run button!) I get this message:
ImportError: No module named caffe.layers.detectnet.clustering
terminate called after throwing an instance of 'boost::python::error_already_set'
The program has unexpectedly finished.

but when I open a terminal in my project folder and run the exe by ./EXEname, everything is okey, I haven't tried this before, I just copied the exe to caffe root. but now I see that the problem only occurs when I try to run it from my IDE, though I don't understand why it is like this.

@lukeyeager
Copy link
Member

Then this is probably a generic IDE configuration issue and not related to Caffe specifically.

@alpop
Copy link

alpop commented Jan 6, 2017

I had same problem while in IDE (Spyder): ImportError: No module named layers.detectnet.clustering
It was OK from terminal, too.
It turned out that I had multiple python installations and multiple python caffe modules.
I resolved the issue by removing the offending one with 'conda uninstall caffe

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

No branches or pull requests

3 participants