Hey thanks, it worked.
By the way, checkpoint['state'] = model.state_dict() this code used to work on my previous projects. In fact Pytorch also suggest the same code in its docs for checkpointing. But this code is not working anymore.
Is this checkpoint['state'] = {name: t.clone() for name, t in model.state_dict()} the new way of checkpointing?