Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

“out of memory” when running extract_mesh.py #205

Open
Nabla-GIT opened this issue Aug 17, 2024 · 0 comments
Open

“out of memory” when running extract_mesh.py #205

Nabla-GIT opened this issue Aug 17, 2024 · 0 comments

Comments

@Nabla-GIT
Copy link

Nabla-GIT commented Aug 17, 2024

hello,
I'm running extract_mesh.py to extract the mesh from 15000.pt:

python extract_mesh.py -s gaussian_splatting\datas\inputs\data1\ -c gaussian_splatting\datas\outputs\out1\ -m output\coarse\data1\sugarcoarse_3Dgs7000_densityestim02_sdfnorm02\15000.pt

but it turns out: out of memory!!!(see details below)

VRAM of my GPU(rtx 4050 laptop) is 8GB, I know it is insufficient

what should I do?

Thanks a lot !

details:




-----Parameters-----
Source path: gaussian_splatting\datas\inputs\data1\
Gaussian Splatting Checkpoint path: gaussian_splatting\datas\outputs\out1\
Coarse model Checkpoint path: output\coarse\data1\sugarcoarse_3Dgs7000_densityestim02_sdfnorm02\15000.pt
Mesh output path: output\coarse_mesh\data1
Surface levels:
[0.1, 0.3, 0.5]
Decimation targets:
[200000, 1000000]
Use custom bbox: False
Use eval split: True
GPU: 0
Use centers to extract mesh: False
Use marching cubes: False
Use vanilla 3DGS: False
--------------------
Loading the initial 3DGS model from path gaussian_splatting\datas\outputs\out1\...
Found image extension .JPG
9 training images detected.
The model has been trained for 7000 steps.

Loading the coarse SuGaR model from path output\coarse\data1\sugarcoarse_3Dgs7000_densityestim02_sdfnorm02\15000.pt...
Use min to initialize scales.
Initialized radiuses for 3D Gauss Rasterizer
Coarse model loaded.
Coarse model parameters:
_points
torch.Size([213781, 3])
True
all_densities
torch.Size([213781, 1])
True
_scales
torch.Size([213781, 3])
True
_quaternions
torch.Size([213781, 4])
True
_sh_coordinates_dc
torch.Size([213781, 1, 3])
True
_sh_coordinates_rest
torch.Size([213781, 15, 3])
True
Number of gaussians: 213781
Opacities min/max/mean: tensor(9.6427e-05, device='cuda:0') tensor(1., device='cuda:0') tensor(0.6500, device='cuda:0')
Quantile 0.0: 9.642718214308843e-05
Quantile 0.1: 0.0025188217405229807
Quantile 0.2: 0.01307610608637333
Quantile 0.3: 0.31468358635902405
Quantile 0.4: 0.727897584438324
Quantile 0.5: 0.9511145949363708
Quantile 0.6: 0.9998317956924438
Quantile 0.7: 0.9999556541442871
Quantile 0.8: 0.9999804496765137
Quantile 0.9: 0.9999923706054688

Starting pruning low opacity gaussians...
WARNING! During optimization, you should use a densifier to prune low opacity points.
This function does not preserve the state of an optimizer, and sets requires_grad=False to all parameters.
Number of gaussians left: 143904
Opacities min/max/mean: tensor(0.5000, device='cuda:0') tensor(1., device='cuda:0') tensor(0.9345, device='cuda:0')
Quantile 0.0: 0.5000038146972656
Quantile 0.1: 0.7125014066696167
Quantile 0.2: 0.8746340274810791
Quantile 0.3: 0.9927117824554443
Quantile 0.4: 0.9998162388801575
Quantile 0.5: 0.9999368190765381
Quantile 0.6: 0.9999655485153198
Quantile 0.7: 0.999980092048645
Quantile 0.8: 0.9999889135360718
Quantile 0.9: 0.9999951124191284
Processing frame 0/9...
Current point cloud for level 0.1 has 0 points.
Current point cloud for level 0.3 has 0 points.
Current point cloud for level 0.5 has 0 points.
Traceback (most recent call last):
  File "C:\Users\15088\Desktop\Short PHD 3\3D Gaussian\sugar1\SuGaR-main\extract_mesh.py", line 46, in <module>
    extract_mesh_from_coarse_sugar(args)
  File "C:\Users\15088\Desktop\Short PHD 3\3D Gaussian\sugar1\SuGaR-main\sugar_extractors\coarse_mesh.py", line 277, in extract_mesh_from_coarse_sugar
    frame_surface_level_outputs = sugar.compute_level_surface_points_from_camera_fast(
  File "C:\Users\15088\Desktop\Short PHD 3\3D Gaussian\sugar1\SuGaR-main\sugar_scene\sugar_model.py", line 1995, in compute_level_surface_points_from_camera_fast
    closest_gaussian_inv_scaled_rotation = gaussian_inv_scaled_rotation[pass_closest_gaussians_idx]
torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 1.07 GiB (GPU 0; 6.00 GiB total capacity; 10.50 GiB already allocated; 0 bytes free; 11.29 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant