首先安装caffe的时候Python的版本可选系统自带的Python2.7或者Python3.5,也可以使用anaconda中的Python版本,对应的Makefile.config中的Python路径对应的改变。
安装protobuf的方法也有好几种:
sudo apt-get install libprotobuf-dev protobuf-compiler #Linux系统级的安装
sudo pip install google protocol #python2.7版本的安装
sudo pip3 install google protocol #python3.5版本的安装
conda install protobuf #anaconda版本的安装
查看系统中已安装的protobuf:
whereis protoc #查看那些路径下安装了protobuf
which protoc #查看默认选用的protobuf
protoc --version #查看当前默认的protobuf的版本
sudo protoc --version #查看系统的protobuf的版本
所以在编译caffe如果报的错关于Google或者protobuf的,例如:
.build_release/src/caffe/proto/caffe.pb.h:12:2: error: #error This file was generated by a newer version of protoc which is
error: #error incompatible with your Protocol Buffer headers. Please up