I created a fine-tuned model based on resnet18:
resnet18 = torch.hub.load('pytorch/vision:v0.4.2', 'resnet18', pretrained=True)
reset18_base = torch.nn.Sequential(*(list(resnet18.children())[:-2]))
head_layers = [some layers.. ]
resnet_head = nn.Sequential(*head_layers)
model = nn.Sequential(reset18_base, resnet_head)

I trained it and it works well, now I need to save and load it elsewhere.
Should I use this code for the model object (to load a state dict into) instead of a Class containing an init and a forward?
I’m wondering about best practices in cases such as mine.