caffe编译问题

1.

.build_release/lib/libcaffe.so: undefined reference to `boost::re_detail::cpp_regex_traits_implementation<char>::transform_primary(char const*, char const*) const'
.build_release/lib/libcaffe.so: undefined reference to `boost::re_detail::cpp_regex_traits_implementation<char>::transform(char const*, char const*) const'
.build_release/lib/libcaffe.so: undefined reference to `boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >::maybe_assign(boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > > const&)'
.build_release/lib/libcaffe.so: undefined reference to `boost::re_detail::put_mem_block(void*)'
.build_release/lib/libcaffe.so: undefined reference to `boost::re_detail::get_mem_block()'
.build_release/lib/libcaffe.so: undefined reference to `boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::do_assign(char const*, char const*, unsigned int)'
.build_release/lib/libcaffe.so: undefined reference to `boost::re_detail::raise_runtime_error(std::runtime_error const&)'
.build_release/lib/libcaffe.so: undefined reference to `boost::cpp_regex_traits<char>::toi(char const*&, char const*, int) const'
.build_release/lib/libcaffe.so: undefined reference to `boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::construct_init(boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags)'
.build_release/lib/libcaffe.so: undefined reference to `boost::re_detail::verify_options(unsigned int, boost::regex_constants::_match_flags)'
.build_release/lib/libcaffe.so: undefined reference to `boost::re_detail::get_default_error_string(boost::regex_constants::error_type)'
collect2: error: ld returned 1 exit status
Makefile:625: recipe for target '.build_release/tools/upgrade_net_proto_text.bin' failed
make: *** [.build_release/tools/upgrade_net_proto_text.bin] Error 1

解决:打开Makefile,添加boost_regex到如下代码中

       LIBRARIES += boost_thread stdc++ 
       LIBRARIES += boost_thread stdc++ boost_regex #修改后

2.报错还是以前的错误问题

In file included from src/caffe/solvers/sgd_solver.cpp:7:0:
./include/caffe/util/io.hpp:192:40: error: ‘AnnotatedDatum_AnnotationType’ does not name a type
     const std::string& encoding, const AnnotatedDatum_AnnotationType type,
                                        ^
./include/caffe/util/io.hpp:194:5: error: ‘AnnotatedDatum’ has not been declared
     AnnotatedDatum* anno_datum);
     ^
./include/caffe/util/io.hpp:199:11: error: ‘AnnotatedDatum_AnnotationType’ does not name a type
     const AnnotatedDatum_AnnotationType type, const string& labeltype,
           ^
./include/caffe/util/io.hpp:200:49: error: ‘AnnotatedDatum’ has not been declared
     const std::map<string, int>& name_to_label, AnnotatedDatum* anno_datum) {
                                                 ^
./include/caffe/util/io.hpp:208:5: error: ‘AnnotatedDatum’ has not been declared
     AnnotatedDatum* anno_datum);
     ^
./include/caffe/util/io.hpp:212:5: error: ‘AnnotatedDatum’ has not been declared
     AnnotatedDatum* anno_datum);
     ^
./include/caffe/util/io.hpp:215:22: error: ‘AnnotatedDatum’ has not been declared
     const int width, AnnotatedDatum* anno_datum);
                      ^
./include/caffe/util/io.hpp:218:30: error: ‘LabelMap’ has not been declared
     const string& delimiter, LabelMap* map);
                              ^
./include/caffe/util/io.hpp:221:32: error: ‘LabelMap’ has not been declared
       bool include_background, LabelMap* map) {
                                ^
./include/caffe/util/io.hpp:225:61: error: ‘LabelMap’ has not been declared
 inline bool ReadLabelFileToLabelMap(const string& filename, LabelMap* map) {
                                                             ^
./include/caffe/util/io.hpp:229:27: error: ‘LabelMap’ does not name a type
 bool MapNameToLabel(const LabelMap& map, const bool strict_check,
                           ^
./include/caffe/util/io.hpp:232:34: error: ‘LabelMap’ does not name a type
 inline bool MapNameToLabel(const LabelMap& map,
                                  ^
./include/caffe/util/io.hpp:237:27: error: ‘LabelMap’ does not name a type
 bool MapLabelToName(const LabelMap& map, const bool strict_check,
                           ^
./include/caffe/util/io.hpp:240:34: error: ‘LabelMap’ does not name a type
 inline bool MapLabelToName(const LabelMap& map,
                                  ^
./include/caffe/util/io.hpp:245:34: error: ‘LabelMap’ does not name a type
 bool MapLabelToDisplayName(const LabelMap& map, const bool strict_check,
                                  ^
./include/caffe/util/io.hpp:248:41: error: ‘LabelMap’ does not name a type
 inline bool MapLabelToDisplayName(const LabelMap& map,
                                         ^
src/caffe/solvers/sgd_solver.cpp: In member function ‘virtual void caffe::SGDSolver<Dtype>::SnapshotSolverStateToBinaryProto(const string&)’:
src/caffe/solvers/sgd_solver.cpp:298:9: error: ‘class caffe::SolverState’ has no member named ‘set_iter_last_event’
   state.set_iter_last_event(this->iter_last_event_);
         ^
src/caffe/solvers/sgd_solver.cpp:299:9: error: ‘class caffe::SolverState’ has no member named ‘set_minimum_loss’
   state.set_minimum_loss(this->minimum_loss_);
         ^
src/caffe/solvers/sgd_solver.cpp: In member function ‘virtual void caffe::SGDSolver<Dtype>::RestoreSolverStateFromBinaryProto(const string&)’:
src/caffe/solvers/sgd_solver.cpp:352:34: error: ‘class caffe::SolverState’ has no member named ‘iter_last_event’
   this->iter_last_event_ = state.iter_last_event();
                                  ^
src/caffe/solvers/sgd_solver.cpp:353:31: error: ‘class caffe::SolverState’ has no member named ‘minimum_loss’
   this->minimum_loss_ = state.minimum_loss();
                               ^
src/caffe/solvers/sgd_solver.cpp: In instantiation of ‘Dtype caffe::SGDSolver<Dtype>::GetLearningRate() [with Dtype = float]’:
src/caffe/solvers/sgd_solver.cpp:389:1:   required from here
src/caffe/solvers/sgd_solver.cpp:69:29: error: ‘class caffe::SolverParameter’ has no member named ‘plateau_winsize_size’
     if (this->current_step_ < this->param_.plateau_winsize_size()) {
                             ^
src/caffe/solvers/sgd_solver.cpp:71:13: error: ‘class caffe::SolverParameter’ has no member named ‘plateau_winsize’
             + this->param_.plateau_winsize(this->current_step_);
             ^
src/caffe/solvers/sgd_solver.cpp: In instantiation of ‘Dtype caffe::SGDSolver<Dtype>::GetLearningRate() [with Dtype = double]’:
src/caffe/solvers/sgd_solver.cpp:389:1:   required from here
src/caffe/solvers/sgd_solver.cpp:69:29: error: ‘class caffe::SolverParameter’ has no member named ‘plateau_winsize_size’
     if (this->current_step_ < this->param_.plateau_winsize_size()) {
                             ^
src/caffe/solvers/sgd_solver.cpp:71:13: error: ‘class caffe::SolverParameter’ has no member named ‘plateau_winsize’
             + this->param_.plateau_winsize(this->current_step_);
             ^
Makefile:575: recipe for target '.build_release/src/caffe/solvers/sgd_solver.o' failed
make: *** [.build_release/src/caffe/solvers/sgd_solver.o] Error 1

解决:打开Makefile找到以下代码,修改-isystem->-I

COMMON_FLAGS += $(foreach includedir,$(INCLUDE_DIRS),-isystem $(includedir))
COMMON_FLAGS += $(foreach includedir,$(INCLUDE_DIRS),-I $(includedir)) #修改后

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值