autonomousvision / mip-splatting

[CVPR'24 Best Student Paper] Mip-Splatting: Alias-free 3D Gaussian Splatting
https://niujinshuchong.github.io/mip-splatting/
Other
1.1k stars 71 forks source link

Gaussian model.py training error #56

Closed wuyou012 closed 4 weeks ago

wuyou012 commented 1 month ago

Hi, I just follow your set up in github and using mip360 dataset. When I run the "python scripts/run_mipnerf360.py" There is an error: File "mip-splatting/scene/gaussian_model.py", line 137, in get_opacity_with_3D_filter det1 = scales_square.prod(dim=1) RuntimeError:

How to solve it? thanks a lot

niujinshuchong commented 1 month ago

Hi, could you check if there is any nan value in the scales_square?

wuyou012 commented 4 weeks ago

There is no NaN or Inf value in scales_square. and after I change all the calculate to cpu, it works. Here is my code in "get_opacity_with_3D_filter" function and "reset_opacity" function: scales = self.get_scaling # tensor scales = scales.cpu() if scales.is_cuda else scales scales_square = torch.square(scales) det1 = torch.prod(scales_square, dim=1) filter_3D_cpu = self.filter_3D.cpu()
scales_after_square = scales_square + torch.square(filter_3D_cpu) det2 = torch.prod(scales_after_square, dim=1)
coef = torch.sqrt(det1 / det2) device = opacity.device coef = coef.to(device)