How to retrain/fine-tune based on the pre-trained model

Hello~

I try to initialize the parameters of my model with the pre-trained model.
I am not sure how to retrain/fine-tune based on the pre-defined model.
Is the following code correct?

def resnet18b_fq_lq_tern_tex_4(num_classes=1000):
    model = ResNet(BasicBlock, [2, 2, 2, 2], fp_fl=False, fp_ll=False)
    model.load_state_dict(model_zoo.load_url(model_urls['resnet18']))
    return model

Thank you so much.

I don’t know what the additional fp_ arguments mean, but would assume that the parameter loading should work as long as you don’t get any errors pointing to missing or unexpected keys in the state_dict.

1 Like