Hi I am trying to get the next to last layer after having re trained a Resnet50 but I am not quite sure of how to do that:
Here is the code I was using for loading Resnet and changing the last layer:
net = models.resnet50(pretrained=True)
net.fc = nn.Linear(2048, out_categories)
net.load_state_dict(torch.load(loadModel))
for param in net.parameters():
param.requires_grad = False
Is there a way to drop the final layer?