Hi, I am trying to return the names of the parameters of a finetuned pretrained resnet18 model and I get an empty list. Basically what i want to do is for
                               model = resnet18(pretrained=True)
                               params = []
                               params += [n for n, p in model.named_parameters() if 'layer' in n]
                               print(params)

I get the parameter names printed out as [‘layer1.0.conv1.weight’, layer1.0.bn1.weight’…]
but after finetuning and saving my model and loading, I get an empty list when i try to return a similar list as above.
model = torch.load(‘finetuned_resnet’)
params = []
params += [n for n, p in model.named_parameters() if ‘layer’ in n]
print(params)
Can anyone help explain why this is so?
Thanks