I think I found my problem. Given that i redefined my model as:
class ModifiedResNet18Model(torch.nn.Module):
def init(self):
super(ModifiedResNet18Model, self).init()
model = models.resnet18(pretrained=True)#squeezenet1_1
modules = list(model.children())[:-1]      # delete the last fc layer.
        model = nn.Sequential(*modules)
self.features = model
print("start pruning:")
for param in self.features.parameters():
	param.requires_grad = False

self.fc = nn.Sequential(
	nn.Dropout(),
	nn.Linear(512,400),
	nn.ReLU(inplace=True),
                nn.Dropout(),
	nn.Linear(400,256),
	nn.ReLU(inplace=True),
	nn.Linear(256, 256))

def forward(self, x):
x = self.features(x)
x = x.view(x.size(0), -1)
x = self.fc(x)#self.classifier(x)
return x
I needed to add features when i return it as:
model = torch.load(‘finetuned_resnet’)
params = []
params += [n for n, p in model.features.named_parameters() if ‘layer’ in n]
print(params)
Thanks