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, 0, 0, 1, 1, 1, 1, CUDNN_CONVOLUTION, cudnn::dataType<Dtype>::type)); 

函數定義:

1 cudnnStatus_t CUDNNWINAPI cudnnSetConvolution2dDescriptor(
2                                 cudnnConvolutionDescriptor_t        convDesc,
3                                 int                                 pad_h,    // zero-padding height
4                                 int                                 pad_w,    // zero-padding width
5                                 int                                 u,        // vertical filter stride
6                                 int                                 v,        // horizontal filter stride
7                                 int                                 upscalex, // upscale the input in x-direction
8                                 int                                 upscaley, // upscale the input in y-direction
9                                 cudnnConvolutionMode_t              mode );

上面這個函數是在cudnn.h中定義的,而cudnn不是和cuda一起安裝的,所以問題就是cudnn版本不對,cuda8.0支持的cudnn版本不止一個。

cudnn-v5.就是不匹配的那個,換成cudnn-v7就沒有問題了。

 關於調試,用ocr_test調試:

修改下面代碼(我把下載的模型放到了E盤,這個路徑看自己的模型路徑在那里來設置):

 

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM