I’m trying to train a pre-trained Inception v3 model for my task, which gives as input 178x178 images. It has 5 possible classes so I changed the fully-connected layer to have 5 output feature. My code is the following:

# Pre-trained models
model = models.inception_v3(pretrained=True)

### ResNet or Inception
classifier_input = model.fc.in_features
num_labels = 5

# Replace default classifier with new classifier
model.fc = nn.Linear(classifier_input, num_labels)
model.cuda()

However, I’m getting the following error: RuntimeError: Calculated padded input size per channel: (2 x 2). Kernel size: (5 x 5). Kernel size can’t be greater than actual input size.
I’m not sure what’s the problem as I adopted a similar strategy when training a pre-trained VGG and ResNet.