-
Notifications
You must be signed in to change notification settings - Fork 18.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build Caffe: #error This file was generated by an older version of protoc which is #5645
Comments
I met the same problem too. it seems like u install several protobuf and use the wrong one, something like that. |
I solved this on my computer and maybe it can help you. my environment is Ubuntu14.04, and i installed Anaconda(for python2.7) before i install Caffe. it happens that i used conda to install libprotobuf-dev, and this leads to conflict with the caffe's 'sudo apt-get install libprotobuf-dev' command, for 'apt-get' and conda installed different on my computer which can be find by 'locate protobuf', so i remove the Anaconda's version of libprotobuf, and no problem happens again. |
By the way, if it's of interest, after encounter lots of similar issues across different platforms (different versions of protobuf, glog, python) we decided to provide a higher level support for customizable Caffe builds via CK workflow framework. This framework can detect all installed versions of dependencies (protobuf, cuda, glog, gflags, openblas, cudnn,python) and ask you to select the required one before building Caffe. It is an on-going community project, so maybe it can help you too: |
@limTeTE Your solution works for me! Thank you so much! This problem just made me crazy yesterday ... |
1 similar comment
@limTeTE Your solution works for me! Thank you so much! This problem just made me crazy yesterday ... |
@charan223 hahaha...no shame |
conda uninstall libprotobuf |
@gaoyangyiqiao this's work for me! |
make clean |
This is also worked for me. |
this does not work for me. protoc --version uninstall protobuf using conda won't help, anyone have an idea? thanks..... |
@derkbreeze Did you find a solution to this? I don't understand why the default version installed by protobuf-compiler is 2.5.0 |
@limTeTE it works for me! Thank you very much! |
Closing as solved by the community. Thank you! |
@limTeTE You solved my problem. I've been dealing with it for 2 days and now I love you man. |
I am getting this error @gfursin |
@derkbreeze you can probably retire the old /usr/bin/protoc and replace it with the newer version |
@gaoyangyiqiao My issue is that I need the anaconda installation of libprotobuf and protobuf for another project I am working on. However, I am getting this conflicting issue when trying to install caffe required for Openpose ((https://github.com/CMU-Perceptual-Computing-Lab/openpose/blob/master/doc/installation.md#installation)) . How can I create an environment with libprotobuf and protobuf removed (without removing it from my disk). I understand I need to use a virtual environment for this but my attempts so far have been unsuccessful :(. |
@SreehariRamMohan My suggestion is that you can use older version of protobuf and libprotobuf for caffe related project. And keep the anaconda version of protobuf exist as well. When using anaconda's protobuf, just open a new terminal and type: export PATH = /home/user/anaconda3/bin:$PATH to initialize the anaconda environment. |
@derkbreeze So do I need to create a virtual environment for the Caffe Installation or will doing this allow me to install Caffe without getting conflicts with the protobuf and libprotobuff files. |
Also @derkbreeze I checked the contents of my $PATH just now and it includes /home/user/anaconda3/bin at the start of it. $PATH |
@SreehariRamMohan Then by default, every time you start a terminal, you're entering the anaconda environment which the system should be using protobuf installed by anaconda which possibly will not be compatible with the protobuf needed by caffe, since in caffe the protobuf is version 2.6.0 |
Understood. How should I fix this incompatibility? Should I use a virtual environment? |
@SreehariRamMohan You can create a virtual environment, but for me, my solution is to delete the |
@derkbreeze For some reason when I examine the |
@SreehariRamMohan Open a terminal and do echo $PATH to check your PATH environment. |
I am using a MacOS system. I have never edited my bashrc in the past, just modified the PATH variable. |
I'm experiencing the issue described by the author of this issue despite the fact that I do not have protobuf installed inside a conda environment and the version number in |
@limtete It works for me, too! Thank you!!! |
Adding the the /bin directory of the protoc installation to the PATH variable while removing the conda path solved the issue. |
Hi,
I git clone "caffe" source codes, and have done installation, but when I execute "make all -j $(($(nproc) + 1))" in the Caffe folder, I encountered the below errors. (.build_release/src/caffe/proto/caffe.pb.h:17:2: error:
#error This file was generated by an older version of protoc which is)
So, could you pls give me some suggestions? Thanks!
In file included from ./include/caffe/blob.hpp:9:0,
from ./include/caffe/layers/memory_data_layer.hpp:6,
from src/caffe/layers/memory_data_layer.cpp:7:
.build_release/src/caffe/proto/caffe.pb.h:17:2: error: #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
^
.build_release/src/caffe/proto/caffe.pb.h:18:2: error: #error incompatible with your Protocol Buffer headers. Please
#error incompatible with your Protocol Buffer headers. Please
^
The text was updated successfully, but these errors were encountered: