1.
.build_release/lib/libcaffe.so: undefined reference to `boost::re_detail::cpp_regex_traits_implementation::transform_primary(char const*, char const*) const'
.build_release/lib/libcaffe.so: undefined reference to `boost::re_detail::cpp_regex_traits_implementation::transform(char const*, char const*) const'
.build_release/lib/libcaffe.so: undefined reference to `boost::match_results<__gnu_cxx::__normal_iterator, std::allocator > >, std::allocator, std::allocator > > > > >::maybe_assign(boost::match_results<__gnu_cxx::__normal_iterator, std::allocator > >, std::allocator, std::allocator > > > > > 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 > >::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::toi(char const*&, char const*, int) const'
.build_release/lib/libcaffe.so: undefined reference to `boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator, std::allocator > >, std::allocator, std::allocator > > > >, boost::regex_traits > >::construct_init(boost::basic_regex > > 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& 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::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::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::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::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)) #修改后