在ubuntu下安裝caffe時,使用make all命令後,經常會報出protobuf版本衝突的問題,如下:
In file included from .build_release/src/caffe/proto/caffe.pb.cc:5:0:
.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 This file was generated by a newer version of protoc which is
^
.build_release/src/caffe/proto/caffe.pb.h:13:2: error: #error incompatible with your Protocol Buffer headers. Please update
#error incompatible with your Protocol Buffer headers. Please update
^
.build_release/src/caffe/proto/caffe.pb.h:14:2: error: #error your headers.
#error your headers.
^
...
這個問題的出現是因爲我們在安裝caffe之前,安裝Anaconda或tensorflow時都已經安裝過libprotobuf,所以解決衝突的方法是使用以下命令:
conda uninstall libprotobuf
即可解決。
該解決方案來源於https://stackoverflow.com/questions/36678292/caffe-error-with-protobuf-version