Skip to content

Commit

Permalink
Empty torch cache after optimizer tensor replacement
Browse files Browse the repository at this point in the history
Without the cache emptying I got really high VRAM usage and was not able to train beyond 1 million Gaussians with 24GB VRAM. Now I can train to over 5 million Gaussians.
  • Loading branch information
DerThomy authored Dec 22, 2024
1 parent 491e17a commit 389bbe4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scene/gaussian_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,8 @@ def replace_tensors_to_optimizer(self, inds=None):
self._scaling = optimizable_tensors["scaling"]
self._rotation = optimizable_tensors["rotation"]

torch.cuda.empty_cache()

return optimizable_tensors


Expand Down

0 comments on commit 389bbe4

Please sign in to comment.