Skip to content

Commit f73f67e

Browse files
authored
Fixed the input image size for the resnet18
1 parent 655c6df commit f73f67e

File tree

1 file changed

+2
-2
lines changed
  • tutorials/01-basics/pytorch_basics

1 file changed

+2
-2
lines changed

tutorials/01-basics/pytorch_basics/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def __len__(self):
150150
resnet.fc = nn.Linear(resnet.fc.in_features, 100) # 100 is for example.
151151

152152
# For test.
153-
images = Variable(torch.randn(10, 3, 256, 256))
153+
images = Variable(torch.randn(10, 3, 224, 224))
154154
outputs = resnet(images)
155155
print (outputs.size()) # (10, 100)
156156

@@ -162,4 +162,4 @@ def __len__(self):
162162

163163
# Save and load only the model parameters(recommended).
164164
torch.save(resnet.state_dict(), 'params.pkl')
165-
resnet.load_state_dict(torch.load('params.pkl'))
165+
resnet.load_state_dict(torch.load('params.pkl'))

0 commit comments

Comments
 (0)