Caffe: This file was generated by an older version of protoc which is incompatible with your Protocol Buffer headers. Please regenerate this file with a newer version of protoc.

Created on 4 Sep 2018  ·  5Comments  ·  Source: BVLC/caffe

Issue summary

I am trying to install Caffe (which is required by another github project installation https://github.com/CMU-Perceptual-Computing-Lab/openpose/blob/master/doc/installation.md) however when I begin to install cafe it gives me the error:
`In file included from /Users/sreeharirammohan/Desktop/openpose/build/caffe/src/openpose_caffe-build/include/caffe/proto/caffe.pb.cc:4:
/Users/sreeharirammohan/Desktop/openpose/build/caffe/src/openpose_caffe-build/include/caffe/proto/caffe.pb.h:17:2: error: This file was generated by an older version of protoc which is

error This file was generated by an older version of protoc which is

^
/Users/sreeharirammohan/Desktop/openpose/build/caffe/src/openpose_caffe-build/include/caffe/proto/caffe.pb.h:18:2: error: incompatible with your Protocol Buffer headers. Please

error incompatible with your Protocol Buffer headers. Please

^
/Users/sreeharirammohan/Desktop/openpose/build/caffe/src/openpose_caffe-build/include/caffe/proto/caffe.pb.h:19:2: error: regenerate this file with a newer version of protoc.

error regenerate this file with a newer version of protoc.

`

steps to reproduce

download the anaconda libprotobuf and protobuf packages and attempt to build caffe using these instructions (https://github.com/CMU-Perceptual-Computing-Lab/openpose/blob/master/doc/installation.md)

My conda version is 4.5.11
My libprotobuf version is 3.6.0
My protobuf version is 3.6.0

Tried solutions

Here is what I think is happening based on this thread (https://github.com/BVLC/caffe/issues/5645#issuecomment-418208179) my anaconda versions of libprotobuf and protobuf are messing with the installation of caffe. A post in the above thread told me to simply uninstall them (but I can't because I have other projects on my laptop which require them). I need to somehow be able to create an environment without the conda versions of protobuf and libprotobuf for this project installation. I now a virtual environment would be perfect for this scenario but I have tried and failed to do it multiple times.

System configuration

  • Operating system: MacOS
  • Compiler: Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/c++/4.2.1 Apple LLVM version 9.1.0 (clang-902.0.39.2) Target: x86_64-apple-darwin17.7.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
  • CUDA version (if applicable):
  • CUDNN version (if applicable):
  • BLAS:
  • Python version (if using pycaffe): 3.6.1 Anaconda
  • MATLAB version (if using matcaffe):

Issue checklist

  • [ ] read the guidelines and removed the first paragraph
  • [ ] written a short summary and detailed steps to reproduce
  • [ ] explained how solutions to related problems failed (tick if found none)
  • [ ] filled system configuration
  • [ ] attached relevant logs/config files (tick if not applicable)

Most helpful comment

@SreehariRamMohan check if you have another protobuf installed in your system using the source! if yes then I share my solution.
I had the same problem, I came to know that there was a conflict between two versions of the protobuf installed via apt-get and from the source.
I checked via :
for apt-get:
export PATH=/usr/bin:$PATH
protoc --version

and for source:
export PATH=/usr/local/bin:$PATH
protoc --version

then removed the one installed through source,next I checked again and both were the same version.
after that I used make clean, and then make test, and voila! the problem solved for my case.

All 5 comments

@SreehariRamMohan check if you have another protobuf installed in your system using the source! if yes then I share my solution.
I had the same problem, I came to know that there was a conflict between two versions of the protobuf installed via apt-get and from the source.
I checked via :
for apt-get:
export PATH=/usr/bin:$PATH
protoc --version

and for source:
export PATH=/usr/local/bin:$PATH
protoc --version

then removed the one installed through source,next I checked again and both were the same version.
after that I used make clean, and then make test, and voila! the problem solved for my case.

@itsmahbanoo Thanks for the tips!!!!!! I solved this issue a couple of weeks ago by linking the Caffe protobuf to the OpenPose protobuf using cmake. Thanks for the advice though! I'm sure it will help others facing a similar issue!!!

@itsmahbanoo
Thx. You saved me too!!!

Hi,
how to remove the one installed through source? I've libprotoc 3.0.0 from apt-get and libprotoc 3.4.0 from source.
Tnx

both were the same version.
after that I used make clean, and then make test, and voila! the problem solved for my case.

@ghost

currently, the above two (source/apt) are the same version on my machine, but i still got this error.. Do you know

  1. how did you make and make clean, in which path?
  2. why i still have this problem...
Was this page helpful?
0 / 5 - 0 ratings

Related issues

lixin7895123 picture lixin7895123  ·  3Comments

prathmeshrmadhu picture prathmeshrmadhu  ·  3Comments

iamhankai picture iamhankai  ·  3Comments

hawklucky picture hawklucky  ·  3Comments

kelvinxu picture kelvinxu  ·  3Comments