error如下:
...
In file included from ./include/caffe/util/cudnn.hpp:5:0,
from ./include/caffe/util/device_alternate.hpp:40,
from ./include/caffe/common.hpp:19,
from ./include/caffe/data_reader.hpp:8,
from src/caffe/util/blocking_queue.cpp:4:
/usr/local/cuda-9.0/include/cudnn.h:518:1: note: declared here
cudnnSetConvolution2dDescriptor(cudnnConvolutionDescriptor_t convDesc,
^
In file included from ./include/caffe/util/device_alternate.hpp:40:0,
from ./include/caffe/common.hpp:19,
from ./include/caffe/data_reader.hpp:8,
from src/caffe/util/blocking_queue.cpp:4:
./include/caffe/util/cudnn.hpp: In function ‘void caffe::cudnn::createPoolingDesc(cudnnPoolingStruct**, caffe::PoolingParame
ter_PoolMethod, cudnnPoolingMode_t*, int, int, int, int, int, int)’:
./include/caffe/util/cudnn.hpp:127:41: error: too few arguments to function ‘cudnnStatus_t cudnnSetPooling2dDescriptor(cudnn
PoolingDescriptor_t, cudnnPoolingMode_t, cudnnNanPropagation_t, int, int, int, int, int, int)’
pad_h, pad_w, stride_h, stride_w));
^
./include/caffe/util/cudnn.hpp:15:28: note: in definition of macro ‘CUDNN_CHECK’
cudnnStatus_t status = condition; \
^
In file included from ./include/caffe/util/cudnn.hpp:5:0,
from ./include/caffe/util/device_alternate.hpp:40,
from ./include/caffe/common.hpp:19,
from ./include/caffe/data_reader.hpp:8,
from src/caffe/util/blocking_queue.cpp:4:
/usr/local/cuda-9.0/include/cudnn.h:991:1: note: declared here
cudnnSetPooling2dDescriptor(cudnnPoolingDescriptor_t poolingDesc,
^
Makefile:563: recipe for target '.build_release/src/caffe/util/blocking_queue.o' failed
原因
py-faster-rcnn版本的caffe的cudnn实现与系统所安装的cudnn的版本不一致引起的
解决办法
-
将
py-faster-rcnn/caffe-fast-rcnn/include/caffe/util/cudnn.hpp
换成最新版的caffe里的cudnn的实现,即your-caffe-root/include/caffe/util/cudnn.hpp
. 以及对应的cpp文件,py-faster-rcnn/caffe-fast-rcnn/src/caffe/util/cudnn.cpp
由your-caffe-root/src/caffe/util/cudnn.cpp
替换。 -
将
py-faster-rcnn/caffe-fast-rcnn/include/caffe/layers
里的,所有以cudnn开头的文件,例如cudnn_conv_layer.hpp. 都替换成最新版的caffe里的相应的同名文件your-caffe-root/include/caffe/layers/cudnn_*
。同样要将对应源文件替换,py-faster-rcnn/caffe-fast-rcnn/src/caffe/layers/cudnn_*
由your-caffe-root/src/caffe/layers/cudnn_*
替换。