GPU Memory Usage Keeps Increasing in test_quantitative.py
When running python test_quantitative.py --name exp_isr I notice that GPU memory usage keeps increasing during testing. Eventually, it leads to an Out of Memory (OOM) error. However, when testing on the RSR dataset, this issue does not occur.
Do you know what might be causing this and how to fix it? TKS
Hi GTing,
I guess that there may be one place to cause this (line 38-40):
all_results = metric_function.run(visuals, metric_results.keys()) for key in metric_results.keys(): metric_results[key].append(all_results[key])
The code stores the results in each step, so the GPU memory may increase gradually. I suggest using .cpu() to move them to the CPU.
In addition, could you let me know the size of your GPU memory? I tried the code on 3090, and the 24GB GPU memory seems to be enough.
Please feel free to let me know if you still encounter the error.
Thank you for your reply and support! I am using an A40 48GB GPU for testing. The original code works fine, but during additional tests, I modified the input size, which caused the OOM issue.
I appreciate your suggestions and will update the code to prevent GPU memory from increasing.
Thanks again for your help!
Okay, increasing the input size does indeed increase GPU memory usage.
Also, thank you for your interest in our project. If you have any other questions, feel free to ask at any time.