Hey there,
I'm trying WideResNet on the following dataset, which consists of 256x256x3 images which should be classified into 17 classes.
However I have a size issue on the network. With a batch size of 1, I expected a 1x17 output but I get a 64x17 output. With a batch size of 8 I get 512 x 17 output.
I'm trying to understand the shapes of the tensors at each stage with with the following prints:
def forward(self, x):
print(x)
out = self.conv1(x)
print(out)
out = self.block1(out)
print(out)
out = self.block2(out)
print(out)
out = self.block3(out)
print(out)
out = self.relu(self.bn1(out))
print(out)
out = F.avg_pool2d(out, 8)
print(out)
out = out.view(-1, self.nChannels)
print(out)
out = self.fc(out)
print(out)
return out
$ python main.py
Variable containing:
...
[torch.FloatTensor of size 1x3x256x256]
Variable containing:
...
[torch.FloatTensor of size 1x16x256x256]
Variable containing:
...
[torch.FloatTensor of size 1x64x256x256]
Variable containing:
...
[torch.FloatTensor of size 1x128x128x128]
Variable containing:
...
[torch.FloatTensor of size 1x256x64x64]
Variable containing:
...
[torch.FloatTensor of size 1x256x64x64]
Variable containing:
...
[torch.FloatTensor of size 1x256x8x8]
Variable containing:
...
[torch.FloatTensor of size 64x256]
Variable containing:
...
[torch.FloatTensor of size 64x17]