I would like to fine tune the models in the torchvision model zoo on my own dataset. I need to set different learning rate on the original layers and the modified classifier layer. I modified the resnet model like this:
    model = torchvision.models.resnet101(pretrained = False)
    model.fc = nn.Linear(in_features = 2048, out_features = 10)

how could I design the optimizer?
This seems not work
    optimizer = torch.optim.SGD(
            {'params': model.parameters()[:-1], 'lr': 1e-4, 'momentum': 0.9, 'weight_decay': 1e-4},
            {'params': model.parameters()[-1], 'lr': 5e-3, 'momentum': 0.9, 'weight_decay': 1e-4},)