Caffe: ImportError: No module named caffe.proto

Created on 17 Apr 2017  ·  9Comments  ·  Source: weiliu89/caffe

I have installed the caffe before , and when I used your model(I didn't install the caffe again in your model): SSD:Single Shot MultiBox Detector, I found there is error when I run my code:

File "/home2/challenge99/zht/cookpad_hiro/aicc2017/data/AICC/../../scripts/create_food_annoset.py", line 7, in
from caffe.proto import caffe_pb2
ImportError: No module named caffe.proto
Traceback (most recent call last):
File "/home2/challenge99/zht/cookpad_hiro/aicc2017/data/AICC/../../scripts/create_food_annoset.py", line 7, in
from caffe.proto import caffe_pb2
ImportError: No module named caffe.proto

Could you tell me how to solve it, please Thanks!
By the way, I have installed the caffe in the /home2/challenge99/zht/caffe.
Should I installed the caffe in the SSD model again. After the caffe is installed in the SSD model,
the two version of caffe (/challenge99/caffe, and / SSD/caffe) will be conflicted or the system just used the version caffe(SSD/caffe) when I use the caffe to do other caffe program later.

I may missed some information, please tell me if there is.
Thanks!

Most helpful comment

Should be export PYTHONPATH=/home2/challenge99/caffe/python:$PYTHONPATH

All 9 comments

you should add the the path of your caffe .

how to add it @sujinpeng , thanks!

export PYTHONPATH=$PYTHONPATH:/home/**(您服务器的名字)/caffe/pyhon

thanks @sujinpeng , you mean export PYTHONPATH=$PYTHONPATH:/home2/challenge99/caffe/pyhon?

Should be export PYTHONPATH=/home2/challenge99/caffe/python:$PYTHONPATH

thanks! @weiliu89

Note: /home2/challenge99/caffe/ is the path referred to as $CAFFE_ROOT in readme install guide.

So if $CAFFE_ROOT is an env var then export PYTHONPATH=$CAFFE_ROOT/python:$PYTHONPATH should work.

hi weiliu89, l have run export PYTHONPATH=$CAFFE_ROOT/python:$PYTHONPATH in Ubuntu 14.04.5,but l still met the problem:no module named caffe.proto

我添加了export PYTHONPATH=/home/xwy/caffe/python:$PYTHONPATH 但是错误还是那个,怎么回事呀?我明明source 了

Was this page helpful?
0 / 5 - 0 ratings