我之前已经安装了caffe和Fast-RCNN,所以我应该拥有所有需要的库和依赖项。
我需要为另一个使用Caffe的存储库(https://github.com/ronghanghu/natural-language-object-retrieval)重新安装它。
当我跑的时候
make all它给出了以下错误:
CXX .build_release/src/caffe/proto/caffe.pb.cc
In file included from .build_release/src/caffe/proto/caffe.pb.cc:5: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:5:0:
.build_release/src/caffe/proto/caffe.pb.h:26:55: fatal error: google/protobuf/generated_enum_reflection.h: No such file or directory
#include <google/protobuf/generated_enum_reflection.h>
compilation terminated.
make: *** [.build_release/src/caffe/proto/caffe.pb.o] Error 1我想也许protobuf已经更新了,并尝试了
protoc --version它会返回
libprotoc 2.5.0更新版本的protobuf似乎已经发布了(2.6或更高版本)。
所以我的问题是:
1)有没有简单的更新方法?
2)如果我更新了它,会不会影响我之前安装的caffe和fast-rcnn,这取决于旧版本的protobuf?
发布于 2016-04-18 04:08:53
我怀疑您的问题是在包含路径中有多个版本的protobuf。它可能会从旧版本而不是最新版本中提取报头。我可以确认最新的caffe (现在是git master )可以针对ubuntu 14.04LTS中的libprotobuf-dev-2.5.0-9ubuntu1进行干净的编译。
发布于 2018-06-06 17:32:06
我猜在您遇到这个问题之前,您已经使用protoc生成了caffe.pb.h`。如果你这样做了,我的解决方案可能对你有用。
首先,你应该知道你的操作系统中安装了多少个protoc。
例如,在我的操作系统中:
Prompt> whereis protoc
protoc: /usr/bin/protoc /home/xxx/.conda/envs/python27/bin/protoc/usr/share/man/man1/protoc.1.gz因此,在我的操作系统中有2个protoc。您可以使用which protoc和protoc --version来查找默认使用哪个版本的protoc。在我的操作系统中:
Prompt> which protoc
/home/xxx/.conda/envs/python27/bin/protoc
Prompt>protoc --version
libprotoc 3.5.1最后,使用另一个protoc再次创建caffe.pb.h。将目录设置为caffe/src/caffe/proto,然后执行:
/usr/bin/protoc --cpp_out=. caffe.proto发布于 2017-09-26 00:49:22
我在我的电脑上解决了这个问题,也许它能帮助你。我的环境是Ubuntu16.04,我在安装Caffe之前安装了Anaconda( python2.7)。碰巧我使用conda安装libprotobuf-dev,这导致与caffe的'sudo apt-get install libprotobuf-dev‘命令冲突,因为'apt-get’和conda在我的电脑上安装了不同的‘apt-get’,可以通过'locate protobuf‘找到,所以我删除了Anaconda的libprotobuf版本,没有问题再次发生。
conda uninstall libprotobuf当你在安装Caffe之前安装tensorflow时,由于libprotobuf冲突,这个问题也会发生。
https://stackoverflow.com/questions/36678292
复制相似问题