Skip to content
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

Add custom max iou assigner to prevent CPU OOM in training phase #2228

Merged
merged 4 commits into from
Jun 8, 2023

Conversation

jaegukhyun
Copy link
Contributor

@jaegukhyun jaegukhyun commented Jun 8, 2023

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

  • I have added unit tests to cover my changes.​
  • I have added integration tests to cover my changes.​
  • I have added e2e tests for validation.
  • I have added the description of my changes into CHANGELOG in my target branch (e.g., CHANGELOG in develop).​
  • I have updated the documentation in my target branch accordingly (e.g., documentation in develop).
  • I have linked related issues.

License

  • I submit my code changes under the same Apache License that covers the project.
    Feel free to contact the maintainers if that's a concern.
  • I have updated the license header for each file (see an example below).
# Copyright (C) 2023 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

@github-actions github-actions bot added ALGO Any changes in OTX Algo Tasks implementation TEST Any changes in tests labels Jun 8, 2023
@github-actions github-actions bot added the DOC Improvements or additions to documentation label Jun 8, 2023
@jaegukhyun jaegukhyun marked this pull request as ready for review June 8, 2023 03:54
@jaegukhyun jaegukhyun requested a review from a team as a code owner June 8, 2023 03:54
CHANGELOG.md Outdated Show resolved Hide resolved
Co-authored-by: Sungman Cho <[email protected]>
sungmanc
sungmanc previously approved these changes Jun 8, 2023
Copy link
Contributor

@sungmanc sungmanc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the nice work. BTW, how about using our own docstring instead of the original one for CustomMaxIoUAssigner?

goodsong81
goodsong81 previously approved these changes Jun 8, 2023
Copy link
Contributor

@goodsong81 goodsong81 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the great work. Minor comment and question from my side:

@jaegukhyun jaegukhyun dismissed stale reviews from goodsong81 and sungmanc via be39736 June 8, 2023 04:21
@jaegukhyun jaegukhyun requested a review from sungmanc June 8, 2023 06:23
@jaegukhyun jaegukhyun merged commit 302a8dd into openvinotoolkit:develop Jun 8, 2023
@jaegukhyun jaegukhyun deleted the safe-assign branch June 8, 2023 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ALGO Any changes in OTX Algo Tasks implementation DOC Improvements or additions to documentation TEST Any changes in tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants