Anttwo / SuGaR

[CVPR 2024] Official PyTorch implementation of SuGaR: Surface-Aligned Gaussian Splatting for Efficient 3D Mesh Reconstruction and High-Quality Mesh Rendering
https://anttwo.github.io/sugar/
Other
2.36k stars 182 forks source link

Out of Memory: I changed the code to solve the issue, but I'm not sure whether it is reasonable #82

Closed ygtxr1997 closed 10 months ago

ygtxr1997 commented 10 months ago

On a large scene, with >1200 images as input, I met OOM issue. And I made the following modifications:

  1. In sugar_scene/cameras.py: image
  2. In sugar_trainers/coarse_sdf.py and sugar_trainers/refine.py: image

The OOM problem doesn't occur anymore and the training process is ok.


I'm not sure whether I did the right thing?

Anttwo commented 10 months ago

Hello @ygtxr1997,

In theory, this should not change the results. Actually, a lot of people use the data_device='cpu' trick in the original Gaussian Splatting implementation to make the code work with much larger datasets.

I suppose it slows down the optimization process, but I have not tried it myself. I should definitely investigate the speed performance for this.

But don't worry, in theory, it should be ok! And thank you for your message; I should add it to the README.md file, as it could help people working with larger datasets.