编译caffe-segnet:error-This file was generated by a newer version of protoc

一颗行走的大白菜
这个问题浪费了2个小时,在此总结出来,希望能帮到你!!!

问题描述


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
^

原因在于,有两个版本的protoc (2.6.1 和 3.5),因为用anaconda 也按装了protoc
请输入以下命令测试:

protoc --version

输出的是2.6.1

sudo protoc --version

输出的是3.5

可以用whereis protoc 命令查看protoc 安装的位置
用which protoc 查看当前protoc 的位置

问题解决

卸载掉anaconda 版本的protoc ,命令如下

conda uninstall libprotobuf

然后这个问题,解决啦。
对这就这么简单,网上给出的回答,有很多版本,但是不适合我的情况.

猜你喜欢

转载自blog.csdn.net/qq_34650787/article/details/80198805