So I’ll try something like:
for param in model.parameters():
param.requires_grad = False
for param in model.layer4.parameters():
param.requires_grad = True
for param in model.fc.parameters():
param.requires_grad = True
optimizer = torch.optim.SGD([{'params': model.layer4.parameters()},
        {'params': model.fc.parameters()}, args.lr,momentum=args.momentum,weight_decay=args.weight_decay)

Thanks a lot!