Hi, thanks for your quick reply. I have just started using pytorch and thus new to it. Can you show me how do one add a new linear layer to an already established model?
Edit: I have just figured out how to add linear layer. I wrote something like this:
for param in model_vgg.parameters():
(Indented by one tab space) param.requires_grad = False #freeze all the layers
model_vgg.classifier[6].out_features = 52 #set number of output classes to 52
for param in model_vgg.classifier[6].parameters():
(Indented by one tab space)param.requires_grad = True #unfreeze only the last layer of classifier block
model_vgg.classifier=nn.Linear(25088,52)  #I knew that number of inputs to my classifier block was 25088
However, now I want to change only the last layer of my classifier that is model_vgg.classifier[6] and write something like:
model_vgg.classifer[6]=nn.Linear(num_inputs,52)
But here I don’t know the number of inputs to my model_vgg.classifer[6]. How to find that?