Halp! I am trying to feed 512x512 and higher res images to ResNet models in the TorchVision zoo but it keeps throwing size_mismatch errors at me.
Can someone please explain what needs to be changed in following model definition to feed it 512x512 or 1024x1024 dimensions? I am new from Keras and a bit lost here. Thank you!
ResNet model definition:
The error seems to be occurring when executing line 151, in forward x = self.fc(x)
The size mismatch is coming from the output of the last avgpool layer feeding into the input of the resnet.fc module. To feed it larger images you will need to strip the existing fully connected layer and replace it with one with a larger input dimension.