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

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

Open
chengluberkeley opened this issue Apr 18, 2024 · 4 comments
Open

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

chengluberkeley opened this issue Apr 18, 2024 · 4 comments

Comments

@chengluberkeley
Copy link

chengluberkeley commented Apr 18, 2024

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!

@ginazhouhuiwu
Copy link
Contributor

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?

@Filocava99
Copy link

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
Copy link

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

@jb-ye
Copy link
Collaborator

jb-ye commented May 2, 2024

Could you upgrade your gsplat library?

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

4 participants