Skip to content

Clarification on dynamic_img_size and img_size parameters in timm models #2414

Answered by rwightman
vadori asked this question in Q&A

You must be logged in to vote

@vadori so, yeah a bit confusing...


Changing img_size and patch_size are a step change that will permantently change the corresponding value for the model, interpolating the original pretrained values once at load time. Those values change the model configuration such that the dimensions of some parameters are different, it is essentially a different model architecture variation for each combination of those values.

Just like the original model, once resized the model expects all inputs to match the new size.

To again load and use the model correctly after it's been trained or fine-tuned with those values different from the original pretrained weights, you have to continue using the mode…

Replies: 2 comments

You must be logged in to vote
0 replies
Answer selected by vadori

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants