Add custom max iou assigner to prevent CPU OOM in training phase#2228
Merged
jaegukhyun merged 4 commits intoopen-edge-platform:developfrom Jun 8, 2023
Merged
Add custom max iou assigner to prevent CPU OOM in training phase#2228jaegukhyun merged 4 commits intoopen-edge-platform:developfrom
jaegukhyun merged 4 commits intoopen-edge-platform:developfrom
Conversation
sungmanc
reviewed
Jun 8, 2023
Co-authored-by: Sungman Cho <sungman.cho@intel.com>
sungmanc
previously approved these changes
Jun 8, 2023
Contributor
sungmanc
left a comment
There was a problem hiding this comment.
Thanks for the nice work. BTW, how about using our own docstring instead of the original one for CustomMaxIoUAssigner?
goodsong81
previously approved these changes
Jun 8, 2023
goodsong81
left a comment
There was a problem hiding this comment.
Thank you for the great work. Minor comment and question from my side:
otx/algorithms/detection/adapters/mmdet/models/assigners/custom_max_iou_assigner.py
Show resolved
Hide resolved
…m_max_iou_assigner.py Co-authored-by: Songki Choi <songki.choi@intel.com>
goodsong81
approved these changes
Jun 8, 2023
sungmanc
approved these changes
Jun 8, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When a training image contain too many gt(over > 10000), current assigner, matching anchor bbox and gt, raises CPU OOM.
This is because assigner makes too large cpu tensor matrix. To fix this problem, this PR add a new custom max iou assigner.
This new custom max iou assigner splits gt bboxes into reasonable size when gt bboxes is too large. This may lead time increase but prevent sudden cpu oom.
How to test
In my desktop which has 64GB RAM cannot train Kiemgetal dataset. However after this fix, my desktop can train Kiemgetal dataset.
Checklist
License
Feel free to contact the maintainers if that's a concern.