Synchronized-BatchNorm-PyTorch icon indicating copy to clipboard operation
Synchronized-BatchNorm-PyTorch copied to clipboard

test gap between training and test

Open ZhiweiYan-96 opened this issue 5 years ago • 3 comments

Hi~ Thanking for your code firstly !

I use the SyncBatch for training SSD, when training I can get 46.81% mAP after 10 epoches finishes. However, when I use the saved model, I only get 36.7% mAP

Here is how I convert model ssd_student = convert_model(ssd_student) net_student = ssd_student

This is code for saving model torch.save(net_student.state_dict(), 'weights/' + model_name + '/ssd300_COCO_' + repr(iteration) + '_%.2f.pth' % mAP_student)

When load saved model, I didnt use the convert_model to convert to SyncBN since i think there is no need to convert model when key actually is the same.

I couldn't find where I'm wrong, please give some kind advice, thank you !!

ZhiweiYan-96 avatar Aug 19 '19 13:08 ZhiweiYan-96

Same question

MJITG avatar Aug 21 '19 09:08 MJITG

I am sorry that I am not currently actively using this tool. Can any of the users provide a minimal script for reproducing the train-test gap results? Appreciate!

vacancy avatar Aug 21 '19 14:08 vacancy

Thank you for your code contribution. The same thing happened to me. Maybe there are some bugs in keeping track of batch statistics.

phtu-cs avatar Nov 10 '23 03:11 phtu-cs