roytseng-tw / Detectron.pytorch

A pytorch implementation of Detectron. Both training from scratch and inferring directly from pretrained Detectron weights are available.
MIT License
2.82k stars 567 forks source link

can't load R50 FPN 2x checkpoint from Detectron #161

Open happynewya opened 5 years ago

happynewya commented 5 years ago

Expected results

load checkpoints from Detectron R-50_FPN_2x image

Actual results

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
~/work/Detectron.pytorch/tools/train_net_step.py in <module>()
    457
    458 if __name__ == '__main__':
--> 459     main()

~/work/Detectron.pytorch/tools/train_net_step.py in main()
    307     if args.load_detectron:  #TODO resume for detectron weights (load sgd momentum values)
    308         logging.info("loading Detectron weights %s", args.load_detectron)
--> 309         load_detectron_weight(maskRCNN, args.load_detectron)
    310
    311     lr = optimizer.param_groups[0]['lr']  # lr of non-bias parameters, for commmand line outputs.

~/work/Detectron.pytorch/lib/utils/detectron_weight_helper.py in load_detectron_weight(net, detectron_weight_file)
     21         d_name = name_mapping[p_name]
     22         if isinstance(d_name, str):  # maybe str, None or True
---> 23             p_tensor.copy_(torch.Tensor(src_blobs[d_name]))
     24
     25

KeyError: 'conv_rpn_fpn2_w'

Detailed steps to reproduce

python tools/train_net_step.py --dataset coco2017 --cfg configs/baselines/e2e_faster_rcnn_R-50-FPN_2x.yaml --bs 4 --load_detectron data/pretrained_model/detectron/e2e_faster_rcnn_R-50-FPN-2x.pkl

System information