安装protobuf3.3.0 并安装caffe

余生颓废 提交于 2019-12-29 21:29:40
  • 本电脑有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

 

 

 

 

  •  

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!