老卫带你学---caffe问题汇总

在caffe编译过程中,不管是新的caffe,还是几年前的caffe,亦或是不同的配置,都会大大小小出现一些小问题,该文章尽量将所有遇到的问题全部汇总,方便后期查看。

问题1:

Makefile:563: recipe for target '.build_release/src/caffe/test/test_smooth_L1_loss_layer.o' failed

打开这个文件删掉第11行报错的头文件
#include “caffe/vision_layers.hpp”

问题2:

编译caffe出现错误:

make: *** [.build_release/src/caffe/common.o] Error 1

或者

Makefile:581: recipe for target '.build_debug/src/caffe/test/test_tanh_layer.o' failed

这是因为当前版本的caffe的cudnn实现与系统所安装的cudnn的版本不一致引起的。

解决办法:

1.将./include/caffe/util/cudnn.hpp 换成最新版的caffe里的cudnn的实现,即相应的cudnn.hpp.

  1. 将./include/caffe/layers里的,所有以cudnn开头的文件,例如cudnn_conv_layer.hpp。 都替换成最新版的caffe里的相应的同名文件。

3.将./src/caffe/layer里的,所有以cudnn开头的文件,例如cudnn_lrn_layer.cu,cudnn_pooling_layer.cpp,cudnn_sigmoid_layer.cu。

都替换成最新版的caffe里的相应的同名文件。(可以用已经正常安装好的新的caffe进行替换)

rbgirshick的py-faster-rcnn实现,因为其cudnn实现为旧版本的实现,所有出现了以上问题.

问题3:

出现如下错误:

nvcc fatal   : Unsupported gpu architecture 'compute_20'

解决办法:由于安装的cuda版本是9.1,当前下载的caffe版本比较旧,需要修改里面的makefile文件,屏蔽makefile文件中CUDA_ARCH下面的部分代码,如图:
这里写图片描述

问题4:

/usr/include/boost/python/detail/wrap_python.hpp:50:23: fatal error: pyconfig.h: No such file or directory

python路径都改为了anaconda的路径,但是CPLUS的path没有设置,系统中我也没把anaconda设置成默认的python导致的。

make clean 
export CPLUS_INCLUDE_PATH=/usr/include/python2.7 
make all -j8

问题5:

在编译好faster-rcnn之后,需要将其数据与模型下载下来,可是当我们运行脚本时出现错误:

hades@hades-ThinkPad-Edge-E440:~/software/face-py-faster-rcnn-master/data/scripts$ ./fetch_faster_rcnn_models.sh 
File already exists. Checking md5...
Checksum is incorrect. Need to download again.
Downloading Faster R-CNN demo models (695M)...
--2018-08-09 17:23:12--  https://dl.dropboxusercontent.com/s/o6ii098bu51d139/faster_rcnn_models.tgz?dl=0
Resolving dl.dropboxusercontent.com (dl.dropboxusercontent.com)... 69.171.234.48
Connecting to dl.dropboxusercontent.com (dl.dropboxusercontent.com)|69.171.234.48|:443... failed: Connection refused.
Unzipping...

gzip: stdin: unexpected end of file
tar: Child returned status 1
tar: Error is not recoverable: exiting now
Done. Please run this command again to verify that checksum = ac116844f66aefe29587214272054668.

根本就下在不下来数据,于是有朋友将其数据存到百度云上,大家可以直接下载。
https://pan.baidu.com/s/1o8NdJrc

密码是:gbpo

问题6:

在编译make pycaffe时出现错误:

rcnn$ make pycaffe
CXX/LD -o python/caffe/_caffe.so python/caffe/_caffe.cpp
python/caffe/_caffe.cpp:1:52: fatal error: Python.h: No such file or directory
 #include <Python.h>  // NOLINT(build/include_alpha)
                                                    ^
compilation terminated.
Makefile:507: recipe for target 'python/caffe/_caffe.so' failed
make: *** [python/caffe/_caffe.so] Error 1
hades@hades-ThinkPad-Edge-E440:~/software/face

遇到此类问题基本是caffe找不到python,因此在make py之前反复确认下anaconda或python所在目录是否存在。

因为是从别人的github上download下来的faster-rcnn,所以在makefile.config文件中要修改自己的python路径。

这里写图片描述

猜你喜欢

转载自blog.csdn.net/yixieling4397/article/details/81535337