Hi, Thank you for the follow up. Yes, I tried the official solution but still it didn’t work. There’s no problem with model save/load. The problem is optimizer state save/load. In my current case, the below code raises an error:
best_optim_pars = copy.deepcopy(optimizer.state_dict())

When I update the code by removing copy.deepcopy as below:
best_optim_pars = optimizer.state_dict()

Then the line here gives error:
optimizer.load_state_dict(best_optim_pars)