Hi all,
I am saving state of optimizer and getting this error
“state_dict() missing 1 required positional argument: ‘self’”.
Code:
torch.save({
            'epoch': num_epochs,
            'model_state_dict': model.state_dict(),
            'optimizer_state_dict': opt_func.state_dict(),
             'lr':lr,
            'loss': val_loss,
            'accuracy': val_acc 
            }, 'CNN-model.pt')

Any help shall be highly appreciated