1
votes

I am trying to install Caffe on Ubuntu 16.04. As I want to use it with OpenPose, I don't want to use Anaconda for the installation of Caffe. After having installed a lot of Caffe dependencies (following multiple tutorials online), I discovered that protobuf was installed using python:

$pip show protobuf
Name: protobuf
Version: 3.6.1
Summary: Protocol
Buffers Home-page: https://developers.google.com/protocol-buffers/
Author: None Author-email: None License: 3-Clause BSD License
Location: /home/userq/.local/lib/python2.7/site-packages
Requires: setuptools, six
Required-by:

I know from past experiences that using apt-get install libprotobuf-dev protobuf-compiler installs a protobuf version that is older than 3.6.1, so I downloaded protobuf 3.6.1 binaries and put them in /usr/bin and /usr/include. Now I have:

$ protoc --version
libprotoc 3.6.1

But when I try to build Caffe, It fails:

CXX .build_release/src/caffe/proto/caffe.pb.cc In file included from .build_release/src/caffe/proto/caffe.pb.cc:4: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:4:0: .build_release/src/caffe/proto/caffe.pb.h:23:35: fatal error: google/protobuf/arena.h: No such file or directory compilation terminated. Makefile:598: recipe for target '.build_release/src/caffe/proto/caffe.pb.o' failed make: *** [.build_release/src/caffe/proto/caffe.pb.o] Error 1

When I open the file .build_release/src/caffe/proto/caffe.pb.h, I find that such an error message is generated when the protobuf version is older than 3.6.1. Here's an excerpt from this file:

#if GOOGLE_PROTOBUF_VERSION < 3006001
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers.  Please update
#error your headers.
#endif
#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers.  Please
#error regenerate this file with a newer version of protoc.
#endif

I don't think there is a version conflict in this case. And although I have the version 3.6.1, it looks like the system doesn't detect it. What could be the problem?

1

1 Answers

0
votes

I also have the same issue but I think it is because of protoc --version 3.6 try to install protoc 3.0 for me it solved.