Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

caffe: error with protobuf version

I've previously installed caffe and Fast-RCNN, so I should have all the required libraries and dependencies.

I need to install it again for another repository(https://github.com/ronghanghu/natural-language-object-retrieval) that uses Caffe.

When I run

make all

it gives me the following error:

CXX .build_release/src/caffe/proto/caffe.pb.cc
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.
^
In file included from .build_release/src/caffe/proto/caffe.pb.cc:5:0:
.build_release/src/caffe/proto/caffe.pb.h:26:55: fatal error: google/protobuf/generated_enum_reflection.h: No such file or directory
#include <google/protobuf/generated_enum_reflection.h>

compilation terminated.
make: *** [.build_release/src/caffe/proto/caffe.pb.o] Error 1

I thought maybe protobuf has been updated, and tried

protoc --version

which returns

libprotoc 2.5.0

It seems like newer version of protobuf has been released (2.6 or up).

So my question would be:

1) Is there a simple way to update it?

2) If I do update it, will it affect caffe and fast-rcnn that I previously installed, which depends on the older version of protobuf?

like image 449
ytrewq Avatar asked Apr 17 '16 15:04

ytrewq


People also ask

How do I check protobuf version?

To check which version of protobuf is installed, use pip show protobuf or pip3 show protobuf in your CMD/Powershell (Windows), or terminal (macOS/Linux/Ubuntu) to obtain the output major.

How do I downgrade a protobuf package?

Downgrade the protobuf package to 3.20. x or lower. 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

Is protobuf binary format?

Protobuf is a binary message format crafted by Google and is efficient compared to other message formats like JSON & XML.


1 Answers

I suspect your problem is that you have multiple versions of protobuf in your include path. It may be picking up the headers from the older version instead of the latest. I can confirm that latest caffe (git master as of right now) compiles cleanly against the libprotobuf-dev-2.5.0-9ubuntu1 which is in ubuntu 14.04LTS.

like image 99
Alex I Avatar answered Sep 28 '22 06:09

Alex I