Caffe-GPU编译错误:In file included from src/caffe/util/signal_handler.cpp:7:0:./include/caffe/util/signa

本文解决在编译Caffe-GPU时遇到的fatal error:caffe/proto/caffe.pb.h:No such file or directory错误。通过修改环境变量CPLUS_INCLUDE_PATH并指向正确的python头文件目录,可以成功解决该问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

编译Caffe-GPU时出现以下错误:

In file included from src/caffe/util/signal_handler.cpp:7:0:
./include/caffe/util/signal_handler.h:4:34: fatal error: caffe/proto/caffe.pb.h: No such file or directory
compilation terminated.
Makefile:585: recipe for target '.build_release/src/caffe/util/signal_handler.o' failed
make: *** [.build_release/src/caffe/util/signal_handler.o] Error 1
make: *** Waiting for unfinished jobs....

解决方法:

export CPLUS_INCLUDE_PATH=/home/XXX/anaconda3/include/python3.6m:$CPLUS_INCLUDE_PATH   //XXX表示自己的路径
//如果没有生效,需要将 /home/XXX 换成 ~

再让配置生效.

source ~/.bashrc
/usr/include/boost/math/tools/config.hpp:23:6: warning: #warning "The minimum language standard to use Boost.Math will be C++14 starting in July 2023 (Boost 1.82 release)" [-Wcpp] 23 | # warning "The minimum language standard to use Boost.Math will be C++14 starting in July 2023 (Boost 1.82 release)" | ^~~~~~~ [ 86%] Building CXX object src/caffe/CMakeFiles/caffe.dir/util/signal_handler.cpp.o [ 86%] Building CXX object src/caffe/CMakeFiles/caffe.dir/util/upgrade_proto.cpp.o /root/docker/app/filebrowser/srv/GaussianHairCut/ext/openpose/3rdparty/caffe/src/caffe/util/io.cpp: In function ‘bool caffe::ReadProtoFromBinaryFile(const char*, google::protobuf::Message*)’: /root/docker/app/filebrowser/srv/GaussianHairCut/ext/openpose/3rdparty/caffe/src/caffe/util/io.cpp:57:66: error: no matching function for call to ‘google::protobuf::io::CodedInputStream::SetTotalBytesLimit(const int&, int)’ 57 | coded_input->SetTotalBytesLimit(kProtoReadBytesLimit, 536870912); | ^ In file included from /root/docker/app/filebrowser/srv/GaussianHairCut/ext/openpose/3rdparty/caffe/src/caffe/util/io.cpp:2: /usr/include/google/protobuf/io/coded_stream.h:384:8: note: candidate: ‘void google::protobuf::io::CodedInputStream::SetTotalBytesLimit(int)’ 384 | void SetTotalBytesLimit(int total_bytes_limit); | ^~~~~~~~~~~~~~~~~~ /usr/include/google/protobuf/io/coded_stream.h:384:8: note: candidate expects 1 argument, 2 provided make[5]: *** [src/caffe/CMakeFiles/caffe.dir/build.make:1906: src/caffe/CMakeFiles/caffe.dir/util/io.cpp.o] Error 1 make[5]: *** Waiting for unfinished jobs.... In file included from /usr/include/boost/bind/detail/requires_cxx11.hpp:9, from /usr/include/boost/bind/bind.hpp:24, from /usr/include/boost/bind.hpp:29, from /root/docker/app/filebrowser/srv/GaussianHairCut/ext/openpose/3rdparty/caffe/src/caffe/util/signal_handl
03-14
In file included from /usr/include/boost/math/special_functions/detail/round_fwd.hpp:11, from /usr/include/boost/math/special_functions/math_fwd.hpp:29, from /usr/include/boost/math/special_functions/next.hpp:13, from /root/Workspace/openpose/3rdparty/caffe/src/caffe/util/math_functions.cpp:1: /usr/include/boost/math/tools/config.hpp:23:6: warning: #warning "The minimum language standard to use Boost.Math will be C++14 starting in July 2023 (Boost 1.82 release)" [-Wcpp] 23 | # warning "The minimum language standard to use Boost.Math will be C++14 starting in July 2023 (Boost 1.82 release)" | ^~~~~~~ In file included from /usr/include/boost/bind/detail/requires_cxx11.hpp:9, from /usr/include/boost/bind/bind.hpp:24, from /usr/include/boost/bind.hpp:29, from /root/Workspace/openpose/3rdparty/caffe/src/caffe/util/signal_handler.cpp:1: /usr/include/boost/bind.hpp:36:1: note: ‘#pragma message: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated. Please use <boost/bind/bind.hpp> + using namespace boost::placeholders, or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior.’ 36 | BOOST_PRAGMA_MESSAGE( | ^~~~~~~~~~~~~~~~~~~~ /root/Workspace/openpose/3rdparty/caffe/src/caffe/util/io.cpp: In function ‘bool caffe::ReadProtoFromBinaryFile(const char*, google::protobuf::Message*)’: /root/Workspace/openpose/3rdparty/caffe/src/caffe/util/io.cpp:57:66: error: no matching function for call to ‘google::protobuf::io::CodedInputStream::SetTotalBytesLimit(const int&, int)’ 57 | coded_input->SetTotalBytesLimit(kProtoReadBytesLimit, 536870912); | ^ In file included from /root/Workspace/openpose/3rdparty/caffe/src/caffe/util/io.cpp:2: /usr/local/include/google/protobuf/io/coded_stream.h:407:8: note: candidate: ‘void google::pr
最新发布
03-17
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值