New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What is the difference between load_from and pretrain? #96
Comments
Hi, Btw, our config is for 8 GPUs. How many GPUs are you using? Please post your log of Nan loss here that we can get more information to help you. Thanks. |
Thanks for your reply! I use 1 GPU, and I use the lr = 0.02/8. My loss log is like below(The losses are all Nan for the first printed iter): size mismatch for roi_head.bbox_head.fc_cls.weight: copying a param with shape torch.Size([81, 1024]) from checkpoint, the shape in current model is torch.Size([2, 1024]). Here is my configure file, where I pre-download the model with the provided url :
lr_config = dict( total_epochs = 4 load_from = ('/data1/code/mmtracking/pretrain_models/faster-rcnn-coco.pth') |
I tried 1 GPU training and my work train successfully. That's my log
Did you modify anything else except the learning rate? |
It seems that you are not using the pre-trained model in mmdetection. Which model are you using? |
I download the model from ''http://download.openmmlab.com/mmdetection/v2.0/faster_rcnn/faster_rcnn_r50_fpn_2x_coco/faster_rcnn_r50_fpn_2x_coco_bbox_mAP-0.384_20200504_210434-a5d8aa15.pth' and put it in the path where I name the 'load_from =' |
Yes, |
Thank you for your responding! |
hi @gsygsygsy123 , |
Hello~ Thanks a lot for your awesome job and I appreciate for your effort! However, I have some problems hoping you to help me solve it.
When I use the default configure at configs/det/faster-rcnn_r50_fpn_4e_mot17-half.py to train faster-rcnn detector by MMtracking, I got Nan losses. But when I change the downloaded state dict, which is pretrained faster-rcnn on COCO dataset, from 'load_from' entry to 'pretrain' entry of detector, the Nan losses disappears. I wonder how this happen? What's the difference between 'load_from' and 'pretrain', since both of them seem not to strictly load parameters?
Thanks a lot again!
I check again, finding that the 'pretrain' entry for detection seems NOT load pretrain dicts as I expected, and directly train from randomly initiated parameters. So how to use the pretrained faster rcnn model dicts anyway?
The text was updated successfully, but these errors were encountered: