文章目錄
所有代碼已上傳到本人github repository:https://github.com/zgcr/pytorch-ImageNet-CIFAR-COCO-VOC-training
如果覺得有用,請點個star喲!
代碼均在pytorch1.4版本中測試過,確認正確無誤。
之前有同學提出從零實現RetinaNet(二)中與原論文點數對標的換算方式不太合理,應該按照最終輸入網絡的圖片大小來換算對標分辨率,因爲只要最終輸入的網絡圖片大小一樣,那麼計算量(這裏指FLOPS)就完全一樣。如果按照這種換算方式,那麼我的resize方法與RetinaNet原始resize方法對標分辨率如下:
retinanet_resize=400,my_resize=667
retinanet_resize=500,my_resize=833
retinanet_resize=600,my_resize=1000
retinanet_resize=700,my_resize=1166
retinanet_resize=800,my_resize=1333
根據新的分辨率對標,我使用my_resize=667和1000在COCO數據集上分別訓練了不同分辨率下的RetinaNet。除了下表列出的超參數外,模型的其他超參數設置與從零實現RetinaNet(七)中ResNet50-RetinaNet-aug-iscrowd的參數設置完全一樣。
模型表現如下:
Network | batch | gpu-num | apex | syncbn | epoch5-mAP-loss | epoch5-mAP-loss | epoch12-mAP-loss |
---|---|---|---|---|---|---|---|
ResNet50-RetinaNet-myresize667 | 24 | 2 | yes | no | 0.264,0.61 | 0.298,0.51 | 0.302,0.49 |
ResNet101-RetinaNet-myresize667 | 24 | 2 | yes | no | 0.269,0.61 | 0.293,0.51 | 0.298,0.49 |
ResNet50-RetinaNet-myresize1000 | 16 | 4 | yes | no | |||
ResNet101-RetinaNet-myresize1000 | 16 | 4 | yes | no |
可以看到如果採用這種方式對標,我實現的RetinaNet和論文中的點數基本一致,在論文中resize=400的情況下只比論文報告點數(0.305)低了0.3個百分點。