caffe_ocr开源项目学习笔记

时间:2023-03-09 21:52:52
caffe_ocr开源项目学习笔记

本机配置cuda8.0使用的cudnn是下面要说的重点,vs2015,win10,1080Ti

下载了开源项目:https://github.com/senlinuc/caffe_ocr

编译的时候报错:caffe_ocr-master/src/caffe/layers/DenseBlock_layer.cu(283): error : too many arguments in function call

调用的地方:

CUDNN_CHECK(cudnnSetConvolution2dDescriptor(*convBC_Descriptor, , , , , , , CUDNN_CONVOLUTION, cudnn::dataType<Dtype>::type));

函数定义:

 cudnnStatus_t CUDNNWINAPI cudnnSetConvolution2dDescriptor(
cudnnConvolutionDescriptor_t convDesc,
int pad_h, // zero-padding height
int pad_w, // zero-padding width
int u, // vertical filter stride
int v, // horizontal filter stride
int upscalex, // upscale the input in x-direction
int upscaley, // upscale the input in y-direction
cudnnConvolutionMode_t mode );

上面这个函数是在cudnn.h中定义的,而cudnn不是和cuda一起安装的,所以问题就是cudnn版本不对,cuda8.0支持的cudnn版本不止一个。

cudnn-v5.就是不匹配的那个,换成cudnn-v7就没有问题了。

caffe_ocr开源项目学习笔记

关于调试,用ocr_test调试:

修改下面代码(我把下载的模型放到了E盘,这个路径看自己的模型路径在那里来设置):

caffe_ocr开源项目学习笔记