nerfstudio icon indicating copy to clipboard operation
nerfstudio copied to clipboard

ValueError: Invalid shape for means3d: torch.Size([0, 3])

Open chengluberkeley opened this issue 10 months ago • 4 comments

Describe the bug Trained splatfacto till 600 steps, then reports the error.

Traceback (most recent call last):
  File "/nerfstudio/scripts/train.py", line 294, in <module>
    entrypoint()
  File "/nerfstudio/scripts/train.py", line 285, in entrypoint
    main(
  File "/nerfstudio/scripts/train.py", line 270, in main
    launch(
  File "/nerfstudio/scripts/train.py", line 199, in launch
    main_func(local_rank=0, world_size=world_size, config=config)
  File "/nerfstudio/scripts/train.py", line 106, in train_loop
    trainer.train()
  File "/nerfstudio/engine/trainer.py", line 273, in train
    loss, loss_dict, metrics_dict = self.train_iteration(step)
  File "/nerfstudio/utils/profiler.py", line 130, in inner
    out = func(*args, **kwargs)
  File "/nerfstudio/engine/trainer.py", line 527, in train_iteration
    _, loss_dict, metrics_dict = self.pipeline.get_train_loss_dict(step=step)
  File "/nerfstudio/utils/profiler.py", line 130, in inner
    out = func(*args, **kwargs)
  File "/nerfstudio/pipelines/base_pipeline.py", line 326, in get_train_loss_dict
    model_outputs = self._model(
  File "/opt/python/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/opt/python/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
    return forward_call(*args, **kwargs)
  File "/nerfstudio/models/base_model.py", line 153, in forward
    return self.get_outputs(ray_bundle)
  File "/nerfstudio/models/splatfacto.py", line 838, in get_outputs
    self.xys, depths, self.radii, conics, comp, num_tiles_hit, cov3d = project_gaussians(  # type: ignore
  File "/opt/python/lib/python3.9/site-packages/gsplat/project_gaussians.py", line 61, in project_gaussians
    return _ProjectGaussians.apply(
  File "/opt/python/lib/python3.9/site-packages/torch/autograd/function.py", line 539, in apply
    return super().apply(*args, **kwargs)  # type: ignore[misc]
  File "/opt/python/lib/python3.9/site-packages/gsplat/project_gaussians.py", line 102, in forward
    raise ValueError(f"Invalid shape for means3d: {means3d.shape}")
ValueError: Invalid shape for means3d: torch.Size([0, 3])

Default training parameters are used.

NerfStudio: 1.0.3 gsplat: 0.1.6

Thank you for the help!

chengluberkeley avatar Apr 18 '24 04:04 chengluberkeley

Hi! What dataset are you training on? means3d: torch.Size([0, 3]) means there are 0 points hence the invalid shape error in projection step. I cannot recreate this error on my end, can you provide more details please?

ginazhouhuiwu avatar Apr 26 '24 06:04 ginazhouhuiwu

Having the same issue, the same dataset used to work fine until today, now it started to give this error, using default parameters with splatfacto

Filocava99 avatar Apr 27 '24 15:04 Filocava99

Everytime it starts it downloads some weights for pytorch: have those been changed and are them causing the issue?

Filocava99 avatar Apr 27 '24 15:04 Filocava99

Could you upgrade your gsplat library?

jb-ye avatar May 02 '24 21:05 jb-ye