longcw / faster_rcnn_pytorch

Faster RCNN with PyTorch
MIT License
1.71k stars 466 forks source link

RoIPooling can not pass the gradcheck #57

Open lvpengyuan opened 6 years ago

lvpengyuan commented 6 years ago

I use the gradcheck function in torch.autograd to check the grad of RoIPooling, and the result is False.

blackyang commented 6 years ago

Similar issue here, I found that RoIPoolingFunction will always output zero.

cuda 8.0, cudnn 6.0, pytorch 0.2.0

dingjiansw101 commented 6 years ago

I encountered the issue in another Faster-RCNN repo(https://github.com/jwyang/faster-rcnn.pytorch). The analytical gradients of the output from the gradcheck function in pytorch are all zero. But when I print the gradient results in RoIPooling module by myself, it is not. Is it the bug of pytorch? Meanwhile, it seems like the numerical gradients of numerical is not stable with eps. When I set eps to be 1e-6, the numerical gradients are also output zero. When I set the eps to be 1e-4, the gradients at the maxid position is approximate to 1.