caffe icon indicating copy to clipboard operation
caffe copied to clipboard

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.

Open SreehariRamMohan opened this issue 6 years ago • 10 comments

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)

SreehariRamMohan avatar Sep 04 '18 07:09 SreehariRamMohan

@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.

ghost avatar Oct 14 '18 20:10 ghost

@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!!!

SreehariRamMohan avatar Oct 15 '18 00:10 SreehariRamMohan

@itsmahbanoo Thx. You saved me too!!!

wonchulSon avatar Mar 29 '19 11:03 wonchulSon

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

cesarecaputi avatar Apr 16 '20 09:04 cesarecaputi

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...

Light-- avatar Nov 24 '20 03:11 Light--

I'm on Fedora 33 and see this:

make all
CXX .build_release/src/caffe/proto/caffe.pb.cc
In file included from .build_release/src/caffe/proto/caffe.pb.cc:4:
.build_release/src/caffe/proto/caffe.pb.h:17:2: error: #error This file was generated by an older version of protoc which is
   17 | #error This file was generated by an older version of protoc which is
      |  ^~~~~
.build_release/src/caffe/proto/caffe.pb.h:18:2: error: #error incompatible with your Protocol Buffer headers. Please
   18 | #error incompatible with your Protocol Buffer headers.  Please
      |  ^~~~~
.build_release/src/caffe/proto/caffe.pb.h:19:2: error: #error regenerate this file with a newer version of protoc.
   19 | #error regenerate this file with a newer version of protoc.
      |  ^~~~~
.build_release/src/caffe/proto/caffe.pb.cc:12:10: fatal error: google/protobuf/wire_format_lite_inl.h: No such file or directory
   12 | #include <google/protobuf/wire_format_lite_inl.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:599: .build_release/src/caffe/proto/caffe.pb.o] Error 1
protoc --version
libprotoc 3.5.1
usr/bin/protoc --version
libprotoc 3.12.4
which protoc
/usr/local/bin/anaconda3/bin/protoc

Getting same issue In usr/bin also same version and protoc --version also same . And tried this BVLC/caffe#6527. Anyone help

mohammedshoibkr avatar Jan 25 '24 07:01 mohammedshoibkr

这是来自QQ邮箱的假期自动回复邮件。   您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。

dragonQian avatar Jan 25 '24 07:01 dragonQian

Hey @mohammedshoibkr did you find a solution?

I think i found something:

System: MacOs Ventura 13.6.3 with a base Anaconda environment. I ran:

export PATH=/usr/bin:$PATH
protoc --version
-> libprotoc 3.20.3
export PATH=/usr/local/bin:$PATH
protoc --version
-> libprotoc 3.20.3
which protoc
-> /Users/username/anaconda3/bin/protoc

So i figured i'd re-install protobuf there, in the anaconda env.

rm /Users/tristanbochu/anaconda3/bin/protoc

then

conda install -c conda-forge protobuf

This error: "older version of protoc which is incompatible with your Protocol Buffer headers..." disappeared :)

titibuild avatar Mar 18 '24 18:03 titibuild

这是来自QQ邮箱的假期自动回复邮件。   您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。

dragonQian avatar Mar 18 '24 18:03 dragonQian