python 版Faster Rcnn

直接按照官网https://github.com/rbgirshick/py-faster-rcnn上的教程对faster Rcnn进行编译的时候,会发有一些层由于cudnn版本的更新,会报错如下:

/cudnn_sigmoid_layer.cu(13): error: argument of type "cudnnActivationMode_t" is incompatible with parameter of type "cudnnActivationDescriptor_t"

在网上查了一下,是由于cudnn的版本更新,接口不兼容造成的,网上有一些博客上采取了修改接口的方法,但是有好几个cpp以及hpp都会修改,比较麻烦,后来在https://github.com/rbgirshick/py-faster-rcnn/issues/237查到了解决办法:

cd caffe-fast-rcnn  
git remote add caffe https://github.com/BVLC/caffe.git  
git fetch caffe  
git merge -X theirs caffe/master  

Remove self_.attr("phase") = static_cast<int>(this->phase_); from include/caffe/layers/python_layer.hpp after merging.

即用目前最新版本的caffe来编译faster rcnn,因为新版本的caffe是采用的cudnn5,因此再按照官网的教程进行编译就不会出错,我机器上是cudnn6,也可以编译通过。

 

posted @ 2018-01-08 10:24  rainsoul  Views(678)  Comments(0Edit  收藏  举报