The images are between 200 x 200 px and 500 x 500 px large. For the purpose of testing the changed made to the model to be able to handle different image sizes, I am still resizing all the images to 304 x 304 pixels. So I can eliminate the size differences as the current error source.
I am using a BatchNorm after every conv layer which is not used to reduce the image dimensions (I have conv layers with a stride > 1 instead of pooling in between conv layers)
Conv -> BatchNorm -> Relu -> Conv (Stride > 1) -> Relu
-> Conv -> BatchNorm -> Relu -> Conv (Stride > 1) -> Relu
I will acquaint myself with nn.InstanceNorm and try it out.
Is there a better way instead of feeding every sample one by one with different sample sizes? The only possibility coming to my mind is Zero-padding, but I am not sure how this affects the training performance.
Thank you very much in advance!