But when I push images of size (512,512) other than (224,224) into my Resnet, it will have 'size mismatch" error at the AvgPooling layer. I am not sure whether that is the case because from documentation these layers seem to work for any shape.
If I change that AvgPooling layer to AdaptivePooling(1) then it will work, but it doesn’t look very efficient.