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

上一篇:google gflags使用指南


下一篇:Windows下Ceres库的配置 包含四个依赖库Eigen、gflags、glad、suitesparse-metis-for-windows的配置