ruotianluo / pytorch-faster-rcnn

pytorch1.0 updated. Support cpu test and demo. (Use detectron2, it's a masterpiece)
MIT License
1.82k stars 477 forks source link

How to use self trained resnet in faster rcnn #148

Open SakshamDarolia opened 4 years ago

SakshamDarolia commented 4 years ago

I am trying to use a self trained resnet101 in faster rcnn. I think that i can get more accurate inferences and results by using one. The issue that I have is when training starts, it throws a Pdb error. This error occurs inside _sample_rois() function located in proposal_target_layer.py. In this function after calculating fg_inds and bg_inds, there are several conditions as shown in below screenshot. Screenshot from 2019-08-21 01-50-34 And according to the conditions the control of the program goes into else(i.e. Pdb block) iff fg_inds and bg_inds both are zero simultaneously. Just for an example, In below screenshot I have used resnet50 from the link provided in GitHub repo, and after some iterations Pdb error occurs. (I have printed fg_inds and bg_inds for preview) Screenshot from 2019-08-19 17-05-17 And if I use a self trained resnet(on a custom dataset), then also it throws a Pdb error, even before the iterations start. So, do I need to train the resnet in caffe(on custom dataset), then convert to pth and then use in faster rcnn? Will that solve this Pdb error? (Right now I have trained Resnet in pytorch.) Or is it that self trained resnets are not supported as of now? And pretrained res50(the one provided in this repo) doesnt work for me either. Please get me with a solution as soon as possible. It is really important. Thanks in advance

SakshamDarolia commented 4 years ago

I am posting first time on GitHub, so I'm sorry if there are any mistakes.

StrongBirds commented 4 years ago

Hello, I have the same problem. Have you solved it?