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

Dense object detection and memory usage #17

Open
JohnMBrandt opened this issue Sep 4, 2024 · 1 comment
Open

Dense object detection and memory usage #17

JohnMBrandt opened this issue Sep 4, 2024 · 1 comment
Labels
question Further information is requested

Comments

@JohnMBrandt
Copy link

Question

Thanks again for your research! The position relation idea is very smart. I've had success improving DINO/ DDQ / Align DETR baselines with Relation DETR for images with <300 objects similar to COCO.

I work on counting trees in aerial images, and am having trouble training models for dense object detection, where image chips can have >1500 objects, e.g. below

example

In these cases, Relation DETR causes OOM errors since an attention matrix between every object has to be constructed. Any thoughts on how to improve training for dense objects?

Additional

No response

@JohnMBrandt JohnMBrandt added the question Further information is requested label Sep 4, 2024
@xiuqhou
Copy link
Owner

xiuqhou commented Sep 5, 2024

Hi @JohnMBrandt Thanks for your question.
For dense object detection, relation computation will consume too much memory. So far, I haven't found a good solution to optimize it. But you can use torch.utils.checkpoint in pytorch to wrap position_relation_embedding as a workaround. It can save memory by recalculating the variables in the back propagation during training.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants