XiangZ-0 / HiT-SR

[ECCV 2024 - Oral] HiT-SR: Hierarchical Transformer for Efficient Image Super-Resolution
Apache License 2.0
77 stars 2 forks source link

gpu usage question #6

Open kimtaehyeong opened 8 hours ago

kimtaehyeong commented 8 hours ago

Hello, Thank you for your good research. I have a question about the inference process.

Currently, I am testing in two ways.

  1. Huggingface inference
  2. HiT-SRF-2x.pth pretrained inference

In case of inference number 2, we confirmed that the GPU runs even at low specifications. However, in case 1, loading the model consumes about 10 GB of memory, and inference requires larger memory requirements. Method 2 only required about 3~5G for inference. May I know why?

thank you

XiangZ-0 commented 4 hours ago

Hi, thanks for your interest in our work! I found a similar issue on my side and I am still trying to figure out why (TBH I am pretty new to hugging face). Will let you know when I find a solution.

If you would like to run with a lower GPU memory, I recommend using the GitHub repo for now. You can also enable the self-ensemble by setting use_chop=True here. This will use a sliding window to chop the input image and fuse the restored patches in the end (might be a bit slower). Hope this helps!

kimtaehyeong commented 4 hours ago

When I find out, I will share it with you. thank you!

XiangZ-0 commented 4 hours ago

That would be great, thanks!