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

Could you please reduce the VRAM usage? Or directly run the program on the RAM? #4

Closed
planb788 opened this issue Aug 1, 2024 · 5 comments

Comments

@planb788
Copy link

planb788 commented Aug 1, 2024

After actual deployment and use, the GPU occupancy easily exceeds 20G, while the video length is only two to three seconds.

@LHY-HongyangLi
Copy link
Collaborator

LHY-HongyangLi commented Aug 1, 2024

Hi @planb788,
Thank you for your attention to our TAPTR and your kind supplement of environment requirements. Recently I've been busy with another work and can not solve these issues immediately. But I have an idea to reduce the memory usage, and you can have a try by yourself:

In the forward function of TAPTR:

if not self.training: # eval path
we process all of the images at first and store the resulting feature maps in GPU memory. You can make some changes here to obtain the feature map of one frame only when tracking points on this frame, and delete the feature map after using it.

This was referenced Aug 1, 2024
@LHY-HongyangLi
Copy link
Collaborator

Hi, @planb788
I happened to have the same need this morning. I added a memory-efficient mode to TAPTR. By simply setting this flag to true, the memory requirement can be reduced to only 8GB.

self.memory_efficient_mode = False

@LHY-HongyangLi
Copy link
Collaborator

I will close this issue, if you have any questions, feel free to reopen this issue.

@sinkers-lan
Copy link

Hi, @LHY-HongyangLi. Thank you for your outstanding work!

I’m curious—does memory_efficient_mode impact the accuracy of your model? I noticed that the evaluation of tapvid_davis_first with memory_efficient_mode is slightly lower than co-tracker.

image

I look forward to your response!

@LHY-HongyangLi
Copy link
Collaborator

It seems that it will indeed hurt the performance, but I have not figure out the reason. 🤕

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

No branches or pull requests

3 participants