caffe安装错误记录

1.[math_functions.cpp:90] Check failed: error == cudaSuccess (11 vs. 0) invalid argument

这是因为编译的CUDA-ARCH跟自己的GPU不对应,查看自己GPU对应的arch,然后修改Makefile.config文件,改动地方:

# For CUDA < 6.0, comment the *_50 through *_61 lines for compatibility.
# For CUDA < 8.0, comment the *_60 and *_61 lines for compatibility.
CUDA_ARCH := -gencode arch=compute_20,code=sm_20 \
        -gencode arch=compute_20,code=sm_21 \
        -gencode arch=compute_30,code=sm_30 \
        -gencode arch=compute_35,code=sm_35 \
        -gencode arch=compute_50,code=sm_50 \
        -gencode arch=compute_52,code=sm_52 \
        -gencode arch=compute_60,code=sm_60 \
        -gencode arch=compute_61,code=sm_61 \
        -gencode arch=compute_61,code=compute_61

2.leveldb出现问题可以试着安装1.19版本解决还有"-fPIC"问题

wget https://github.com/google/leveldb/archive/v1.19.zip
unzip v1.19.zip
cd leveldb-1.19 & make
sudo cp out-shared/libleveldb.so* /usr/local/lib & sudo cp -R include/* /usr/local/include

3.错误:/usr/local/lib/libgflags.a(gflags.cc.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

wget http://github.com/schuhschuh/gflags/archive/master.zip
unzip master.zip 
cd gflags-master/ 
mkdir build 
cd build/ 
export CXXFLAGS="-fPIC" 
cmake .. 
make VERBOSE=1
make 
sudo make install

问题4.Found OpenCV Windows Pack but it has no binaries compatible with your configuration.

You should manually point CMake variable OpenCV_DIR to your build of OpenCV Library.
opencv目录配置不对,我使用cmake指定opencv位置
cmake -D OpenCV_DIR=/home/zsk/opencv-3.1.0/build/ ..

5. libsoxr.so.0:对‘GOMP_parallel@GOMP_4.0’未定义的引用 collect2: error: ld returned 1 exit status

还有其他的冲突问题都可能适用
方法1:可以在cmake后添加 -D WITH_OPENMP=ON或者下载cmake-gui,通过带gui的界面查看并勾选环境,使用cmake-gui 检查WITH-OPENMP 状态,将USE_OPENMP选项勾选.
方法2:一般跟anaconda冲突较多,可以试着从 ~/.bashrc注释Anaconda环境试试 .

faster rcnn caffe版本复现问题

1.AttributeError: 'module' object has no attribute 'text_format'

如没有protobuf解决办法:sudo pip install protobuf==2.5.0
如果有解决方法:
在文件./lib/fast_rcnn/train.py增加一行import google.protobuf.text_format

2.错误:hdf5.h no such file error

opencv有此问题解决方法:
修改文件 /opencv_contrib-3.1.0/modules/hdf/include/opencv2/hdf/hdf5.hpp in line 40:

include "/usr/include/hdf5/serial/hdf5.h"//看你hdf5.h具体位置,可以用whereis hdf5查看

caffe哪个cpp缺就加哪个:
因为已经在Makefile.config 与Makefile 里面加了路径,还是有问题,只能用笨方法,找到好的再改
一般要改的文件为:
~/py-faster-rcnn/caffe-fast-rcnn/src/caffe/net.cpp
~/py-faster-rcnn/caffe-fast-rcnn/include/caffe/util/hdf5.hpp
~/py-faster-rcnn/caffe-fast-rcnn/src/caffe/layers/hdf5_output_layer.cpp
~/py-faster-rcnn/caffe-fast-rcnn/src/caffe/layers/hdf5_data_layer.cpp
~/py-faster-rcnn/caffe-fast-rcnn/include/caffe/layers/hdf5_data_layer.hpp
~/py-faster-rcnn/caffe-fast-rcnn/include/caffe/layers/hdf5_output_layer.hpp
~/py-faster-rcnn/caffe-fast-rcnn/src/caffe/layers/hdf5_data_layer.hpp
~/py-faster-rcnn/caffe-fast-rcnn/src/caffe/layers/hdf5_output_layer.hpp
~/py-faster-rcnn/caffe-fast-rcnn/src/caffe/layers/hdf5_output_layer.cu
~/py-faster-rcnn/caffe-fast-rcnn/src/caffe/layers/hdf5_output_layer.cu

你可能感兴趣的:(caffe安装错误记录)