BVLC / caffe

Caffe: a fast open framework for deep learning.
http://caffe.berkeleyvision.org/
Other
34.14k stars 18.68k forks source link

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

Open SreehariRamMohan opened 6 years ago

SreehariRamMohan commented 6 years ago

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

Issue checklist

ghost commented 6 years ago

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

SreehariRamMohan commented 6 years ago

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

wonchulSon commented 5 years ago

@itsmahbanoo Thx. You saved me too!!!

cesarecaputi commented 4 years ago

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

Light-- commented 4 years ago

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...
SomePersonSomeWhereInTheWorld commented 3 years ago

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
mohammedshoibkr commented 10 months ago

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

dragonQian commented 10 months ago

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

titibuild commented 8 months ago

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 :)

dragonQian commented 8 months ago

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

computational-physcis-2011301020083 commented 4 days ago

sudo apt-get remove protobuf-compiler python -m pip install protobuf==3.6.1