In chapter5-Load the general checkpoint of "SAVING AND LOADING A GENERAL CHECKPOINT IN PYTORCH":
model = Net()
optimizer = optim.SGD(net.parameters(), lr=0.001, momentum=0.9)
checkpoint = torch.load(PATH)
model.load_state_dict(checkpoint['model_state_dict'])
optimizer.load_state_dict(checkpoint['optimizer_state_dict'])
Now, we have loaded parameters of checkpoint for model, but optimizer loaded parameters of net which is saved into checkpoint.
I think optimizer should be loaded parameters of model rather than net, am i right?
cc @suraj813