Related questions
How does the "view" method work in PyTorch?
I am confused about the method view() in the following code snippet.
class Net(nn.Module):
def __init__(self):
super(Net, self).__init__()
self.conv1 = nn.Conv2d(3, 6, 5)
self.pool = nn.MaxPool2d(2,2)
self.conv2 = nn.Conv2d(6, 16, 5)
self.fc1 = …
Best way to save a trained model in PyTorch?
I was looking for alternative ways to save a trained model in PyTorch. So far, I have found two alternatives.
torch.save() to save a model and torch.load() to load a model.
model.state_dict() to save a trained …