Yay! That’s something unique in DL frameworks…
Does that new rectangular cropping method instead of square apply also on training and not only validation?
I found this related paragraph from the Dawnbench blog post , but it was not very clear whether the enhanced rectangular crop of fastai instead of square is used in fastai in prediction only or training as well. The post seems keeps saying in validation
, in prediction
and did not mention training.
A lot of people mistakenly believe that convolutional neural networks (CNNs) can only work with one fixed image size, and that that must be rectangular. However, most libraries support “adaptive” or “global” pooling layers, which entirely avoid this limitation. It doesn’t help that some libraries (such as Pytorch) distribute models that do not use this feature – it means that unless users of these libraries replace those layers, they are stuck with just one image size and shape (generally 224x224 pixels). The fastai library automatically converts fixed-size models to dynamically sized models .
I’ve never seen anyone try to train with rectangular images before, and haven’t seen them mentioned in any research papers yet, and none of the standard deep learning libraries I’ve found support this. So Andrew went away and figured out how to make it work with fastai and Pytorch for predictions.*
P.S.:
I think, found 2 mistakes where it mentioned rectangle but the correct is square which is I think a bit confusing for the reader:
"… were doing something really dumb: we were taking rectangular images "
"…lot of people mistakenly believe that convolutional neural networks (CNNs) can only work with one fixed image size, and that must be rectangular. "