Custom image size for pretrained models #565
Replies: 1 comment 5 replies
-
Yes, you need to pass a different img_size when you create the model, it will interpolate the position embedding when it loads the pretrained weights. It needs to be evenly divisible by the patch size. It should work with the vit, vit_deit, vit_deit_distilled. Has not been implemented for pit, swin, and tnt yet. However you cannot just change the input image on the fly like other models, there is a bit of loss in the interpolation so it relies on fine-tuning to bring the accuracy up on the different sized model. The current train scripts don't have the img size arg plumbed through (would break the convnets right now), so you if you use the scripts here you need to manually hack the img_size arg in.
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I am trying to use Transformer in transformer model and the default image size is 224, is there a way to use pretrained models but change the image size to 320 or other sizes?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions