You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to save this model on colab.
model_save_name = 'classifier.pt'
path = F"/content/gdrive/My Drive/{model_save_name}"
torch.save(LMF.state_dict(), path)
but found error
TypeError Traceback (most recent call last)
in ()
1 model_save_name = 'classifier.pt'
2 path = F"/content/gdrive/My Drive/{model_save_name}"
----> 3 torch.save(LMF.state_dict(), path)
Hi, from the code you showed it seems you are calling .state_dict method on the LMF class itself, rather than on a concrete instance of LMF class. You can refer to this PyTorch documentation on how to properly save checkpoints.
I tried to save this model on colab.
model_save_name = 'classifier.pt'
path = F"/content/gdrive/My Drive/{model_save_name}"
torch.save(LMF.state_dict(), path)
but found error
TypeError Traceback (most recent call last)
in ()
1 model_save_name = 'classifier.pt'
2 path = F"/content/gdrive/My Drive/{model_save_name}"
----> 3 torch.save(LMF.state_dict(), path)
TypeError: state_dict() missing 1 required positional argument: 'self'
The text was updated successfully, but these errors were encountered: