How to change only learning rate when loading optimzer

Hi, I’m loading the optimizer like this.

    optimizer.load_state_dict(ckpoint['optimizer'])

I want to change only learning rate without changing any other things.

how can I fix it?

You can assign a new learning rate to the desired param_group, e.g.:

optimizer.param_groups[0]['lr'] = 1e-3

should work.