Drexubery / ViewCrafter

Official implementation of "ViewCrafter: Taming Video Diffusion Models for High-fidelity Novel View Synthesis"
Apache License 2.0
788 stars 24 forks source link

About GPU Memories reported in README.md #23

Open Yukun-Huang opened 2 weeks ago

Yukun-Huang commented 2 weeks ago

Hi, I would like to ask about the GPU memories reported in Line 118 of 01672dc, which mentions a memory requirement of 23.5GB. Does this refer to the total memory cost for the entire process (including the DUSt3R), or is it only for the video diffusion model?

I attempted to run the ViewCrafter_25 model on a GPU with 48 GB of memory, but encountered a "CUDA out of memory" error. I'd like to confirm if this behavior is expected.

Thank you for your help!

Drexubery commented 2 weeks ago

Hi, 23.5GB is only for the video diffusion model. Are you processing more than 30 input images using DUSt3R? It will raise an OOM error.

Yukun-Huang commented 2 weeks ago

Thank you for the quick response! No, I was simply running the provided inference script: "sh run.sh". The initial point cloud has been successfully obtained and saved, but a CUDA OOM error occurred during the forward pass of video diffusion. Does it have to be run on an 80G GPU like A100?

Also, is there an official inference script for the smaller models like ViewCrafter_25_512?

Thanks again and congrats on your great work!

Drexubery commented 2 weeks ago

Thanks! It doesn't have to run on a 80G A100; we conducted all the experiments on a single 40G A100 / 32G V100 GPU, and didn't encountered any OOM error. Theoretically, if you run run.sh without modifying any parameters, it should not raise an OOM error. Are you concurrently running other procedures on your GPU machine? BTW, to run the ViewCrafter_25_512 model, you should modify --height 576 --width 1024 --config configs/inference_pvd_1024.yaml in run.sh to --height 320 --width 512 --config configs/inference_pvd_512.yaml , and change the hard coded resolution in https://github.com/Drexubery/ViewCrafter/blob/01672dcb3efda1f39b7ea1fc5d6da100a4b14c26/viewcrafter.py#L147 https://github.com/Drexubery/ViewCrafter/blob/01672dcb3efda1f39b7ea1fc5d6da100a4b14c26/utils/pvd_utils.py#L533 in to 320x512

Yukun-Huang commented 2 weeks ago

No, I wasn't concurrently running other procedures or modifying any parameters. The information you provided has been very helpful, I think I need to investigate further. I'll provide feedback if I discover anything. Thank you!

FrankYoungchen commented 2 weeks ago

谢谢!它不必在 80G A100 上运行;我们在单个 40G A100 / 32G V100 GPU 上进行了所有实验,没有遇到任何 OOM 错误。理论上,如果您在不修改任何参数的情况下运行 run.sh,它不应该引发 OOM 错误。您是否同时在 GPU 机器上运行其他程序?顺便说一句,要运行 ViewCrafter_25_512 模型,您应该将--height 576 --width 1024 --config configs/inference_pvd_1024.yamlrun.sh 中的修改为 --height 320 --width 512 --config configs/inference_pvd_512.yaml,并将 中的硬编码分辨率更改为

https://github.com/Drexubery/ViewCrafter/blob/01672dcb3efda1f39b7ea1fc5d6da100a4b14c26/viewcrafter.py#L147

https://github.com/Drexubery/ViewCrafter/blob/01672dcb3efda1f39b7ea1fc5d6da100a4b14c26/utils/pvd_utils.py#L533

改为 320x512 It cannot be run directly, and img_ori needs to be resized in line 331 of viewcrafter

FrankYoungchen commented 2 weeks ago

Running a 320x512 input with 24GB of memory still results in an OOM error."

sp77-1 commented 1 week ago

i don't know the reason, but python 3.11 + pytorch 2.4.0 + cuda 12.1 -> ok python 3.10 + pytorch 2.4.0 + cuda 11.8 -> OOM

i'll share here if i figure out why

Yukun-Huang commented 1 week ago

i don't know the reason, but python 3.11 + pytorch 2.4.0 + cuda 12.1 -> ok python 3.10 + pytorch 2.4.0 + cuda 11.8 -> OOM

i'll share here if i figure out why

Cool! It seems that the OOM is indeed caused by the version difference, although my results is different from yours. In my case, python 3.11 + pytorch 2.1.0 + cuda 11.8 -> OK python 3.12 + pytorch 2.4.1 + cuda 12.1 -> OOM