- 本电脑有2个版本python:python2.7和python3.5
首先将环境默认为python3.5 : https://blog.csdn.net/menglanzeng/article/details/82378135
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 100
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 150
安装protobuf3.3.0:参考https://blog.csdn.net/phdsky/article/details/80994090
wget https://github.com/google/protobuf/archive/v3.3.0.zip
unzip protobuf
编译
cd protobuf-3.3.0/
./autogen.sh
./configure
make
make check
sudo make install
sudo ldconfig
protoc --version //查看版本
//python接口
cd protobuf-3.3.0/python/
python setup.py build
python setup.py install
python setup.py test
安装caffe
make all
make test
make runtest
make pycaffe
make pytest
make pytest 时,遇到问题:
ImportError:No module named 'pydot'
解决:
sudo pip install pydot
在python中import caffe时,遇到:
ImportError: No module named 'caffe._caffe'
解决方案:
vi /etc/profile
export PYTHONPATH=/home/zml/zml/caffe/python:$PYTHONPATH