1. 程式人生 > 其它 >caffe 報錯與解決

caffe 報錯與解決

1.error while loading shared libraries: libcaffe.so.1.0.0: cannot open shared object file: No such file or directory

error while loading shared libraries: libcaffe.so.1.0.0: cannot open shared object file: No such file or directory

直接從一個地方拷貝的caffe,然後執行的。
解決方法:

export LD_LIBRARY_PATH=/data_1/model_train/light_on/caffe_multi_focalloss_se/build_310/lib:$LD_LIBRARY_PATH

2.src/caffe/common.cpp:35:5: error: ‘::gflags’ has not been declared


CXX src/caffe/solver.cpp
CXX src/caffe/internal_thread.cpp
CXX src/caffe/common.cpp
src/caffe/common.cpp: In function ‘void caffe::GlobalInit(int*, char***)’:
src/caffe/common.cpp:35:5: error: ‘::gflags’ has not been declared
   ::gflags::ParseCommandLineFlags(pargc, pargv, true);
     ^
make: *** [.build_release/src/caffe/common.o] Error 1

解決方案:
https://github.com/BVLC/caffe/blob/master/include/caffe/common.hpp#L21-L28

註釋掉ifndef
I also got this problem, and I installed gflags by myself before .
And I solved this problem :
in the file include/caffe/common.hpp

//#ifndef GFLAGS_GFLAGS_H_
namespace gflags = google;
//#endif  // GFLAGS_GFLAGS_H_

comment ;
namespace gflags = google;
this code is important