-
Notifications
You must be signed in to change notification settings - Fork 443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support configurable input size #3788
Support configurable input size #3788
Conversation
8113046
to
a40db40
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work. A few points to mention are as follows:
hasatrr()
based branch logics might be quickly rusted and tangled. Hope it would be based on formal interfaces in the future.input_size
term might be better to be more consistent in terms of usage
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me for h-label head!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM w/ one last comment: we may want to touch the mem cache max image size to make this feature more effective in training
(Maybe in another PR? :p)
yes, we can consider including that feature in the next release. |
@goodsong81 I understand your intention. If it doesn't need huge code change, maybe it can be included in this release. Thanks for comment :) |
Summary
This PR includes
Explanation
adds configurable input size feature to OTX
User can configure desired input size after this PR.
input_size
value in 'data' part of recipe is automatically passed to model unless model is already initialized before it's passed to the engine in API use case.Also, user can use adaptive input size which finds appropriate input size based on dataset statistics. Also, user can force to use downscale only which doesn't change input size if bigger input size is considered as proper input size.
All interfaces for input size are added to
OTXDataModule
.So CLI user can uses it by adding
--data.input_size 1000
for configuring input size and--data.adaptive_input_size "auto"
for adaptive input size.API user can use it by setting arguments of
OTXDataModule
. If model is initialized in engine, input_size will be automatically set but if not, then user should set input_size argument of the model by himself or herself.refactor input size in model code
Previously, how input_size is manged in model side is different depending on each model.
Now, it's unified. All models get
input_size
argument and keep it as attribute except zvp model which uses fixed input_size.Model also initializes own module differently based on input_size if necessary.
How to test
Checklist
License
Feel free to contact the maintainers if that's a concern.