Low-rank-Multimodal-Fusion icon indicating copy to clipboard operation
Low-rank-Multimodal-Fusion copied to clipboard

i can't save model on colab

Open komalanadkat opened this issue 3 years ago • 1 comments

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'

komalanadkat avatar May 14 '21 18:05 komalanadkat

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.

Justin1904 avatar May 19 '21 07:05 Justin1904