I haved tried to implement my own CNN with cuDnn. However, I have one problem whenever using cudnnPoolingForward with CUDNN_POOLING _MAX. I found out first several feture maps of pooling results are right, while the remain ones are wrong. I wonder if I set the parameters incorrectly or there exit somes limits with the use of cudnnPoolingForward.
The code below:
checkCUDNN( cudnnSetPooling2dDescriptor(poolingDesc_,
CUDNN_POOLING_MAX,
2, 2, // window
0, 0, // padding
2, 2 // stride
) );
checkCUDNN( cudnnSetTensor4dDescriptor(this->srcTensorDesc_,
this->tensorFormat_,
this->dataType_,
1, 100, // 100 feature maps(48x48) before pooling
48,
48 ) );
checkCUDNN( cudnnSetTensor4dDescriptor(this->dstTensorDesc_,
this->tensorFormat_,
this->dataType_,
1, 100, // 100 feature maps(24x24) after pooling
24,
24) );
checkCUDNN( cudnnPoolingForward(this->cudnnHandle_,
poolingDesc_,
&alpha_,
this->srcTensorDesc_,
srcData,
&beta_,
this->dstTensorDesc_,
this->dstData_) ); // result
Problem: the results of pooling are stored in dstData_, but I found that dstData_[0]~dstData_[16368] are right while the remain ones are wrong.
Please help me. Thank you very much!