fatal error: google/protobuf/arena.h: No such file or directory
mattshma opened this issue · comments
mattshma commented
编译 caffe 时报错如下:
In file included from ./include/caffe/util/cudnn.hpp:8:0,
from ./include/caffe/util/device_alternate.hpp:40,
from ./include/caffe/common.hpp:19,
from ./include/caffe/blob.hpp:8,
from src/caffe/blob.cpp:4:
.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 ./include/caffe/util/cudnn.hpp:8:0,
from ./include/caffe/util/device_alternate.hpp:40,
from ./include/caffe/common.hpp:19,
from ./include/caffe/blob.hpp:8,
from src/caffe/blob.cpp:4:
.build_release/src/caffe/proto/caffe.pb.h:23:35: fatal error: google/protobuf/arena.h: No such file or directory
compilation terminated.
Makefile:581: recipe for target '.build_release/src/caffe/parallel.o' failed
make: *** [.build_release/src/caffe/parallel.o] Error 1
查了下,一个很常见的问题。判断是 anaconda 中 protobuf 与 caffe 需要的 protobuf 版本不一致导致的,查了下相关 #5645。执行如下命令:
make clean
conda uninstall protobuf libprotobuf
make all -j4
make pycaffe
conda install --quiet --yes protobuf libprotobuf