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

AttributeError: 'SplattingModel' object has no attribute 'gauss_params' #1

Closed
MrDieAlot opened this issue May 18, 2024 · 6 comments
Closed

Comments

@MrDieAlot
Copy link

Getting the following error when trying out the ns-splatting command.

Traceback (most recent call last):
File "C:\Users\s_m_d\miniforge3\envs\nerfstudio\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\s_m_d\miniforge3\envs\nerfstudio\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "C:\Users\s_m_d\miniforge3\envs\nerfstudio\Scripts\ns-train.exe_main
.py", line 7, in
File "C:\nerfstudio\nerfstudio\scripts\train.py", line 262, in entrypoint
main(
File "C:\nerfstudio\nerfstudio\scripts\train.py", line 247, in main
launch(
File "C:\nerfstudio\nerfstudio\scripts\train.py", line 189, in launch
main_func(local_rank=0, world_size=world_size, config=config)
File "C:\nerfstudio\nerfstudio\scripts\train.py", line 99, in train_loop
trainer.setup()
File "C:\nerfstudio\nerfstudio\engine\trainer.py", line 160, in setup
self.optimizers = self.setup_optimizers()
File "C:\nerfstudio\nerfstudio\engine\trainer.py", line 225, in setup_optimizers
param_groups = self.pipeline.get_param_groups()
File "C:\nerfstudio\nerfstudio\pipelines\base_pipeline.py", line 441, in get_param_groups
model_params = self.model.get_param_groups()
File "C:\nerfstudio\nerfstudio\models\splatfacto.py", line 633, in get_param_groups
gps = self.get_gaussian_param_groups()
File "C:\nerfstudio\nerfstudio\models\splatfacto.py", line 622, in get_gaussian_param_groups
return {
File "C:\nerfstudio\nerfstudio\models\splatfacto.py", line 623, in
name: [self.gauss_params[name]]
File "C:\Users\s_m_d\miniforge3\envs\nerfstudio\lib\site-packages\torch\nn\modules\module.py", line 1695, in getattr
raise AttributeError(f"'{type(self).name}' object has no attribute '{name}'")
AttributeError: 'SplattingModel' object has no attribute 'gauss_params'

@Siming-He
Copy link
Collaborator

Hi, thank you for reporting the error!

Could you tell me in more details about the command you are running? I update the code yesterday so that "splatting" method is called "nerfgs" now (to align with the naming in the paper).

Could you also mention your Python, nerfstudio, gsplat, and Torch version?

@MrDieAlot
Copy link
Author

Hi! Got the same error with the new version, having re-installed everything. Had to install some additional dependencies that I've seen you've now added.

This is the command I'm running, and also get a warning straight after

(nerfstudio) B:>ns-train nerfgs --data Nerfs\NerfToGs\Wissahickon --max-num-iterations 1 --pipeline.model.ply-file-path Nerfs\nerfgs\nerfgs.ply nerfstudio-data --eval-mode filename
C:\Users\s_m_d\miniforge3\envs\nerfstudio\lib\site-packages\tyro_fields.py:343: UserWarning: The field ply_file_path is annotated with type <class 'str'>, but the default value None has type <class 'NoneType'>. We'll try to handle this gracefully, but it may cause unexpected behavior.
warnings.warn(

Am running python 3.10 through miniforge, Nerfstudio version 1.10 in a dedicated environment, latest dev version, Torch 2.1.2. Not sure about gsplat, that the same as splatfacto?

@Siming-He
Copy link
Collaborator

Getting the following error when trying out the ns-splatting command.

Traceback (most recent call last): File "C:\Users\s_m_d\miniforge3\envs\nerfstudio\lib\runpy.py", line 196, in _run_module_as_main return run_code(code, main_globals, None, File "C:\Users\s_m_d\miniforge3\envs\nerfstudio\lib\runpy.py", line 86, in run_code exec(code, run_globals) File "C:\Users\s_m_d\miniforge3\envs\nerfstudio\Scripts\ns-train.exe__main.py", line 7, in File "C:\nerfstudio\nerfstudio\scripts\train.py", line 262, in entrypoint main( File "C:\nerfstudio\nerfstudio\scripts\train.py", line 247, in main launch( File "C:\nerfstudio\nerfstudio\scripts\train.py", line 189, in launch main_func(local_rank=0, world_size=world_size, config=config) File "C:\nerfstudio\nerfstudio\scripts\train.py", line 99, in train_loop trainer.setup() File "C:\nerfstudio\nerfstudio\engine\trainer.py", line 160, in setup self.optimizers = self.setup_optimizers() File "C:\nerfstudio\nerfstudio\engine\trainer.py", line 225, in setup_optimizers param_groups = self.pipeline.get_param_groups() File "C:\nerfstudio\nerfstudio\pipelines\base_pipeline.py", line 441, in get_param_groups model_params = self.model.get_param_groups() File "C:\nerfstudio\nerfstudio\models\splatfacto.py", line 633, in get_param_groups gps = self.get_gaussian_param_groups() File "C:\nerfstudio\nerfstudio\models\splatfacto.py", line 622, in get_gaussian_param_groups return { File "C:\nerfstudio\nerfstudio\models\splatfacto.py", line 623, in name: [self.gauss_params[name]] File "C:\Users\s_m_d\miniforge3\envs\nerfstudio\lib\site-packages\torch\nn\modules\module.py", line 1695, in getattr raise AttributeError(f"'{type(self).name}' object has no attribute '{name}'") AttributeError: 'SplattingModel' object has no attribute 'gauss_params'

I just fixed this error. Could you try again by running
ns-train nerfgs --data DATA-PATH --max-num-iterations 1 --pipeline.model.ply-file-path exports/nerfgs/nerfgs.ply nerfstudio-data --eval-mode filename

I was using a very old version of nerfstudio. So I have to update the nerfgsModel for the newer nerfstudio versions.

@MrDieAlot
Copy link
Author

MrDieAlot commented May 20, 2024

The training works now, but the result from running nerfgs in the viser, as well as the output ply looks odd. Attaching file of it.

Screenshot 2024-05-20 120517

Also getting this warning:
C:\Users\s_m_d\miniforge3\envs\nerfstudio\lib\site-packages\torch\optim\lr_scheduler.py:136: UserWarning: Detected call of lr_scheduler.step() before optimizer.step(). In PyTorch 1.1.0 and later, you should call them in the opposite order: optimizer.step() before lr_scheduler.step(). Failure to do this will result in PyTorch skipping the first value of the learning rate schedule. See more details at https://pytorch.org/docs/stable/optim.html#how-to-adjust-learning-rate
warnings.warn("Detected call of lr_scheduler.step() before optimizer.step(). "

And still getting this warning, don't know if it's relevant:
C:\Users\s_m_d\miniforge3\envs\nerfstudio\lib\site-packages\tyro_fields.py:343: UserWarning: The field ply_file_path is annotated with type <class 'str'>, but the default value None has type <class 'NoneType'>. We'll try to handle this gracefully, but it may cause unexpected behavior.
warnings.warn(

@Siming-He
Copy link
Collaborator

The training works now, but the result from running nerfgs in the viser, as well as the output ply looks odd. Attaching file of it.

Screenshot 2024-05-20 120517

Also getting this warning: C:\Users\s_m_d\miniforge3\envs\nerfstudio\lib\site-packages\torch\optim\lr_scheduler.py:136: UserWarning: Detected call of lr_scheduler.step() before optimizer.step(). In PyTorch 1.1.0 and later, you should call them in the opposite order: optimizer.step() before lr_scheduler.step(). Failure to do this will result in PyTorch skipping the first value of the learning rate schedule. See more details at https://pytorch.org/docs/stable/optim.html#how-to-adjust-learning-rate warnings.warn("Detected call of lr_scheduler.step() before optimizer.step(). "

And still getting this warning, don't know if it's relevant: C:\Users\s_m_d\miniforge3\envs\nerfstudio\lib\site-packages\tyro_fields.py:343: UserWarning: The field ply_file_path is annotated with type <class 'str'>, but the default value None has type <class 'NoneType'>. We'll try to handle this gracefully, but it may cause unexpected behavior. warnings.warn(

Hi, does it work when you use older version of nerfstudio?

@MrDieAlot
Copy link
Author

Yes, I managed to get it to work that way!

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

2 participants