I’ll keep this brief. These are the shapes for the input I am passing to my network.
print(images.shape)
print(images.view(images.shape[0], -1).shape)
print([len(image_datasets[key]) for key in image_datasets.keys()])
torch.Size([32, 3, 224, 224])
torch.Size([32, 150528])
[6552, 818, 819]
The first layer in my classifier, within VGG16 network, expects 150528 inputs for this very reason. However, when I pass the same after reshaping it, I get the following error in the forward pass:
RuntimeError: size mismatch, m1: [32 x 25088], m2: [150528 x 7168]
I really don’t understand where 25088 comes from. Can someone please help?