caffe2 icon indicating copy to clipboard operation
caffe2 copied to clipboard

[Raspbian] ImportError: No module named caffe2.proto

Open choonkiattay opened this issue 9 years ago • 2 comments

I successfully build caffe2 on rpi3 by following the installation guide from caffe2.ai when i try to follow tutorials, it complains

pi@raspberrypi:~/caffe2/build/caffe2/python $ python workspace_test.py Traceback (most recent call last): File "workspace_test.py", line 5, in <module> from caffe2.proto import caffe2_pb2 ImportError: No module named caffe2.proto Any additional step after ./scripts/build_raspbian.sh ?

choonkiattay avatar May 06 '17 13:05 choonkiattay

I do not install caffe2, but use PYTHONPATH to locate it. Run test at caffe2 root directory. ~/caffe2 $ export PYTHONPATH=build ~/caffe2 $ python build/caffe2/python/workspace_test.py

astroli avatar May 06 '17 16:05 astroli

@astroli export PYHONPATH on build is working but raspbian seems do not remember PYTHONPATH

I edited .bashrc to make it remember PYTHONPATH. `git clone --recursive https://github.com/caffe2/caffe2.git

cd caffe2 ./scripts/build_raspbian.sh

#at home directory leafpad .bashrc

#Scroll until the end then insert PYTHONPATH here export PYTHONPATH=${PYTHONPATH}:/home/pi/caffe2/build/

source .bashrc

#Check PYTHONPATH $echo PYTHONPATH

#Confirm the build by ~/caffe2 $ python build/caffe2/python/workspace_test.py`

choonkiattay avatar May 07 '17 14:05 choonkiattay