PyTorch 2 · Training and saving
Save a model
Save the weights, which is recommended over pickling the whole model.
torch.save(model.state_dict(), "model.pt")
Official PyTorch 2 documentation
PyTorch 2 · Training and saving
Save the weights, which is recommended over pickling the whole model.
torch.save(model.state_dict(), "model.pt")
Official PyTorch 2 documentation
Was this page helpful?