pytorch-retinanet icon indicating copy to clipboard operation
pytorch-retinanet copied to clipboard

Inference using load_state_dict

Open Karthik-U-94 opened this issue 5 years ago • 1 comments

I have created Model using torch.save(retinanet.state_dict(), 'model_final.pt') Now I have changed

from retinanet import model

    ##########################

    retinanetModel = model.resnet101(num_classes=3,)
    retinanetModel.load_state_dict(torch.load(model_path), strict=False)

    if torch.cuda.is_available():
        retinanetModel = retinanetModel.cuda()

    retinanetModel.training = False
    retinanetModel.eval()

    ##########################
    
    scores, classification, transformed_anchors = retinanetModel(image.cuda().float())

No objects are Detecting. Please help me out

Karthik-U-94 avatar Aug 05 '20 07:08 Karthik-U-94

@Karthik-U-94 you can use this https://github.com/yhenon/pytorch-retinanet/issues/200#issuecomment-748992020

ajithvcoder avatar Dec 21 '20 14:12 ajithvcoder