When saving the model state dictionary, you use both torch.save(model, ...) and torch.save(model.state_dict(), ...). It's recommended to use the latter (state_dict()) for saving only the parameters, which is more memory-efficient. If you use torch.save(model, ...), it saves the entire model, including unnecessary information.
When saving the model state dictionary, you use both torch.save(model, ...) and torch.save(model.state_dict(), ...). It's recommended to use the latter (state_dict()) for saving only the parameters, which is more memory-efficient. If you use torch.save(model, ...), it saves the entire model, including unnecessary information.