py-faster-rcnn使用时caffe编译错误解决办法

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的版本不一致引起的

解决办法
  1. 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.cppyour-caffe-root/src/caffe/util/cudnn.cpp 替换。

  2. 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_* 替换。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值