Custom resnet50 weights on pytorch faster rcnn backbone

Hi,

I want to detect heart using stanford chestxray dataset with the help of torchvision.models.detection.fasterrcnn_resnet50_fpn. Now when i set torchvision.models.detection.fasterrcnn_resnet50_fpn(pretrained=True) it will have the pretrained weights which i dont want. For my problem, i have already trained a resnet 50 model using stanford chestxray dataset and i want those weights of the checkpoints as the weights of the backbone for the faster rcnn object detector. Please help me how to use them in the torchvision model. Thanks

You could either try to load your state_dict into the backbone via accessing model.backbone and changing some keys in the state_dict if needed or alternatively create a new model as seen here with your custom backbone.