一
http://blog.csdn.net/sinat_31802439/article/details/52958791
python.config no such file
解決:
1 makeflie文件Python路徑正確
2 包含PYTHONPATH(bahsrc)
二
build_release/tools/caffe: error while loading shared libraries: libhdf5_hl.so.10: cannot open shared object file: No such file or directory
解決:
-
Go to the libraries directory:
cd /usr/lib/x86_64-linux-gnu
-
Link the system version of HDF5 from 7 to 9:
sudo ln -s libhdf5_serial_hl.so.10.0.2 libhdf5_hl.so.10 sudo ln -s libhdf5_serial.so.10.1.0 libhdf5.so.10
-
Update the "Dynamic Linker":
sudo ldconfig
三
/usr/lib/libopencv_highgui.so.2.4: undefined reference to TIFFRGBAImageOK@LIBTIFF_4.0' 1>
/usr/lib/libopencv_highgui.so.2.4: undefined reference toTIFFReadRGBAStrip@LIBTIFF_4.0'
解決方式前面說了,就是編譯opencv的時候要加上 -D BUILD_TIFF=ON
然后又出現了這個錯誤,這個錯誤曾讓我苦惱了兩天,還因此把系統搞崩潰一次....不得不重裝
最后還是多虧了最開頭提到的博客以及熱心網友 _無聲的雨 的幫助,非常感謝,當代活雷鋒啊!
//usr/lib/x86_64-linux-gnu/libx264.so.142:對‘__exp_finite@GLIBC_2.15’未定義的引用
//usr/lib/x86_64-linux-gnu/libx264.so.142:對‘__log10_finite@GLIBC_2.15’未定義的引用
//usr/lib/x86_64-linux-gnu/libxvidcore.so.4:對‘__logf_finite@GLIBC_2.15’未定義的引用
//usr/lib/x86_64-linux-gnu/libvorbis.so.0:對‘__acosf_finite@GLIBC_2.15’未定義的引用
解決方法:如果你裝了anaconda包的話,刪除anaconda/lib/下面的 libm
sudo rm -rf libm*
四
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,
In file included from /usr/local/include/gtest/internal/gtest-internal.h:64:0,
from /usr/local/include/gtest/gtest.h:58,
from src/gtest/gtest-all.cpp:39:
/usr/local/include/gtest/internal/gtest-string.h: In constructor ‘testing::internal::GTestFlagSaver::GTestFlagSaver()’:
/usr/local/include/gtest/internal/gtest-string.h:157:3: error: ‘testing::internal::String::String()’ is private
String(); // Not meant to be instantiated.
解決:
一步一步來。
error: ‘AnnotatedDatum’ does not name a type 說明沒找到定義,去看一下 “./include/caffe/data_transformer.hpp:69:24:”
void Transform(const AnnotatedDatum& anno_datum,
Blob<Dtype>* transformed_blob,
RepeatedPtrField<AnnotationGroup>* transformed_anno_vec);
結論同樣:沒有定義。
grep 一下,看看AnnotatedDatum定義到底在哪,很快,找到:
“caffe/proto/caffe.pb.h”
於是看看這個caffe.pb.h 怎么來的,發現是make 的第一步
PROTOC src/caffe/proto/caffe.proto
的產物,事實上,caffe.proto--→caffe.pb.h 這個過程是成功的,caffe.pb.h 也包含在路徑之中。
那么問題來了:
CXX src/caffe/data_transformer.cpp找到了頭文件caffe.pb.h而且,caffe.pb.h也給了AnnotatedDatum定義,那么為什么編譯的時候報錯AnnotatedDatum沒定義(而非找不到caffe.pb.h)????
經過一系列痛苦的debug,原因在於Makefile 里面的一句話:
COMMON_FLAGS += $(foreach includedir,$(INCLUDE_DIRS),-isystem $(includedir))
注意藍色字部分,
-isystem 是gcc的參數,表示引用路徑,但是但是但是:
If a standard system include directory, or a directory specified with-isystem, is also specified with-I, the -Ioption is ignored. The directory is still searched but as asystem directory at its normal position in the system include chain. This is to ensure that GCC's procedure to fix buggy system headers andthe ordering for theinclude_next
directive are not inadvertently changed. If you really need to change the search order for system directories,use the-nostdinc and/or -isystem
options.
大意就是-isystem里面如果和-I里面的頭文件有沖突,會忽略-I!!!!!!!!
也就是,如果系統中(比如/usr/local/include)等地方有同名文件,會不進行本地(比如/home/XXX/caffe/include)的頭文件搜索。
巧合的是,我之前安裝caffe的時候又一次用了cmake,手賤寫了make install。。。。。。於是我系統里確實有一套基礎caffe環境,和ssd不同。。。。。。
至此,
改了幾個字母:-isystem ---->-I
問題解決。