hsubramani42:

for param in model.parameters: 
    param.requires_grad=False



Hi, I set the first layers with requires_grad = False using
    for name, param in model.named_parameters():
        if name == 'fc2.weight':
            break
        else:
            param.requires_grad_(False)

and leave the two last fully connected layers with requires_grad = True. Then I trained and tested the model in a normal way. It did not converge