caffe 报错与解决

Posted 无左无右

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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

以上是关于caffe 报错与解决的主要内容,如果未能解决你的问题,请参考以下文章

libtorch 报错与解决

libtorch 报错与解决

《报错与问题解决方案》总结v1.0版本

Datax 源码打包报错与解决方法

weblogic使用过程中的部分报错与解决方案

tensorflow2.报错与解决 Cannot convert a symbolic Tensor