how to save a Pytorch model? - Stack Overflow
stackoverflow.com › questions › 66821329Mar 26, 2021 · This answer is not useful. Show activity on this post. to save: # save the weights of the model to a .pt file torch.save (model.state_dict (), "your_model_path.pt") to load: # load your model architecture/module model = YourModel () # fill your architecture with the trained weights model.load_state_dict (torch.load ("your_model_path.pt")) Share.