faster-rcnn在編譯時遇到的一些問題
阿新 • • 發佈:2018-12-19
在安裝faster-rcnn事如果報這種錯誤
In file included from ./include/caffe/util/device_alternate.hpp:40:0, from ./include/caffe/common.hpp:19, from ./include/caffe/blob.hpp:8, from ./include/caffe/net.hpp:10, from ./include/caffe/solver.hpp:7, from ./include/caffe/sgd_solvers.hpp:7, from src/caffe/solvers/adam_solver.cpp:3: ./include/caffe/util/cudnn.hpp: In function ‘const char* cudnnGetErrorString(cudnnStatus_t)’: ./include/caffe/util/cudnn.hpp:21:10: warning: enumeration value ‘CUDNN_STATUS_RUNTIME_PREREQUISITE_MISSING’ not handled in switch [-Wswitch] switch (status) { ^ ./include/caffe/util/cudnn.hpp: In function ‘void caffe::cudnn::setConvolutionDesc(cudnnConvolutionStruct**, cudnnTensorDescriptor_t, cudnnFilterDescriptor_t, int, int, int, int)’: ./include/caffe/util/cudnn.hpp:108:70: error: too few arguments to function ‘cudnnStatus_t cudnnSetConvolution2dDescriptor(cudnnConvolutionDescriptor_t, int, int, int, int, int, int, cudnnConvolutionMode_t, cudnnDataType_t)’ pad_h, pad_w, stride_h, stride_w, 1, 1, CUDNN_CROSS_CORRELATION)); ^
處理方案:
這種問題出現的原因是在rbg開源這套物體檢查方案時是依據的當時最新的cundnn版本,而這麼多年過去,cudnn已經發布了好幾個版本,所以要處理這個問題,只需要將caffe框架下的所有cudnn相關的檔案替換車成當前caffe最新的即可.
rbg的faster-rcnn模型程式碼地址: https://github.com/rbgirshick/py-faster-rcnn
cafe框架的程式碼地址: https://github.com/BVLC/caffe
進入faster-rcnn目錄下caffe-fast-rcnn的src/caffe/util/cudnn.cpp 以及src/caffe/layers/cudnn中的所有檔案,還有include/util/cudnn.hpp 和include/layers/cudnn