williamyang1991 / FRESCO

[CVPR 2024] FRESCO: Spatial-Temporal Correspondence for Zero-Shot Video Translation
https://www.mmlab-ntu.com/project/fresco/
Other
736 stars 72 forks source link

run on Colab with A100 GPU and 40G GPU RAM still got Error #28

Open bingjiw opened 8 months ago

bingjiw commented 8 months ago

run webUI.py on Colab with A100 GPU and 40G GPU RAM still got Error:

torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 12.25 GiB (GPU 0; 39.56 GiB total capacity; 21.83 GiB already allocated; 10.45 GiB free; 22.58 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

截屏2024-03-24 14 23 53
williamyang1991 commented 8 months ago

Can you run the example videos on 40GB on Colab? My example video requires less than 24 GB on my 4090 GPU.

bingjiw commented 8 months ago

Yes, the example of "run_fresco.ipynb" is sucessfully running on Colab with A100 with 40GB GPU RAM.

williamyang1991 commented 8 months ago

What is the resolution of the video that causes your OOM?

bingjiw commented 8 months ago

1280x720.mp4 and 640x360.mov

williamyang1991 commented 8 months ago

Then it will be resized to 512x896 Compared to 512*512 (example video), it has 1.75X pixels Then, in our feature optimization, we need to compute the gram matrix, which will be 1.75x1.75=3.0625X memory. Causing OOM.

Maybe you can use smaller batch size or resize video to smaller resolution. https://github.com/williamyang1991/FRESCO/blob/b3148c210f85be60fb10d4e51548c6b65f03f80b/config/config_carturn.yaml#L20 https://github.com/williamyang1991/FRESCO/blob/9fe1be71b6c21890b5bc92659026f9586440266e/run_fresco.py#L170

bingjiw commented 8 months ago

thank you