Skip to content

CUDA out of memory. Tried to allocate 263168.02 GiB. #14

@marinaog

Description

@marinaog

Hi! I'm trying to run your experiments and I'm finding some issues when running RawNeRF's dataset. I'm getting this error:

2025-11-28 11:18:46,433 INFO: Start training from epoch: 0, iter: 0 Traceback (most recent call last): File "/home/marina/PhD/RawSLAM/LE3D/basicgs/train.py", line 241, in <module> train_pipeline(root_path) File "/home/marina/PhD/RawSLAM/LE3D/basicgs/train.py", line 181, in train_pipeline model.optimize_parameters(current_iter) File "/home/marina/le3d/lib/python3.12/site-packages/basicgs/pipelines/le3d_pipeline.py", line 161, in optimize_parameters self.output_pkg = self.net_g(self.curr_camera) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/marina/le3d/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1751, in _wrapped_call_impl return self._call_impl(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/marina/le3d/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1762, in _call_impl return forward_call(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/marina/le3d/lib/python3.12/site-packages/basicgs/gaussians/gs_base_arch.py", line 498, in forward rendered_image, gs_count_pack, radii = rasterizer( ^^^^^^^^^^^ File "/home/marina/le3d/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1751, in _wrapped_call_impl return self._call_impl(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/marina/le3d/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1762, in _call_impl return forward_call(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/marina/PhD/RawSLAM/LE3D/submodules/gcnt-rasterization/gcnt_rasterization/__init__.py", line 218, in forward return rasterize_gaussians( ^^^^^^^^^^^^^^^^^^^^ File "/home/marina/PhD/RawSLAM/LE3D/submodules/gcnt-rasterization/gcnt_rasterization/__init__.py", line 37, in rasterize_gaussians return _RasterizeGaussians.apply( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/marina/le3d/lib/python3.12/site-packages/torch/autograd/function.py", line 575, in apply return super().apply(*args, **kwargs) # type: ignore[misc] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/marina/PhD/RawSLAM/LE3D/submodules/gcnt-rasterization/gcnt_rasterization/__init__.py", line 97, in forward num_rendered, color, depth, alpha, radii, geomBuffer, binningBuffer, imgBuffer = _C.rasterize_gaussians(*args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ torch.OutOfMemoryError: CUDA out of memory. Tried to allocate 263168.02 GiB. GPU 0 has a total capacity of 7.54 GiB of which 7.34 GiB is free. Including non-PyTorch memory, this process has 182.00 MiB memory in use. Of the allocated memory 18.90 MiB is allocated by PyTorch, and 37.10 MiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True to avoid fragmentation. See documentation for Memory Management (https://pytorch.org/docs/stable/notes/cuda.html#environment-variables) (viser) Server stopped

Basically:
torch.OutOfMemoryError: CUDA out of memory. Tried to allocate 263168.02 GiB.

And I don't think it's because of my computer, because I have tried to resize the images and reduce the number of gaussians that are initialized, and the GiB that it tries to allocate is always the same number: 263168.02 GiB.

I'm using this bikes.yaml:

base: options/le3d/base.yaml

name: le3d/bikes

datasets:
  train:
    name: rawnerf_bikes_train
    scene_root: datasets/rawnerf/scenes/bikes/dense

  val:
    name: rawnerf_bikes_val
    scene_root: datasets/rawnerf/scenes/bikes/dense

network_g:
  init_ply_path: datasets/rawnerf/scenes/bikes/dense/sparse/0/points3D.ply

And this is how my directory looks like:

.
├── dense
│   ├── images
│   ├── raw
│   ├── sparse
│   │   └── 0
│   └── stereo
│       ├── consistency_graphs
│       ├── depth_maps
│       └── normal_maps
├── ignore_sparse
│   └── 0
├── images
└── test_preds

I don't know how to fix this, any ideas? Thank you for your work!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions