KevinXu02 / splatfacto-w

Apache License 2.0
73 stars 2 forks source link

AttributeError: 'SplatfactoWModel' object has no attribute 'device' #1

Closed sion3951 closed 2 months ago

sion3951 commented 2 months ago

I am running the command ns-train splatfacto-w --data Input nerfstudio-data and I get this error

Traceback (most recent call last): File "/home/sion/miniconda3/envs/nerfstudio/bin/ns-train", line 8, in sys.exit(entrypoint()) File "/home/sion/nerfstudio/nerfstudio/scripts/train.py", line 262, in entrypoint main( File "/home/sion/nerfstudio/nerfstudio/scripts/train.py", line 247, in main launch( File "/home/sion/nerfstudio/nerfstudio/scripts/train.py", line 189, in launch main_func(local_rank=0, world_size=world_size, config=config) File "/home/sion/nerfstudio/nerfstudio/scripts/train.py", line 99, in train_loop trainer.setup() File "/home/sion/nerfstudio/nerfstudio/engine/trainer.py", line 154, in setup self.pipeline = self.config.pipeline.setup( File "/home/sion/nerfstudio/nerfstudio/configs/base_config.py", line 53, in setup return self._target(self, kwargs) File "/home/sion/nerfstudio/nerfstudio/pipelines/base_pipeline.py", line 272, in init self._model = config.model.setup( File "/home/sion/nerfstudio/nerfstudio/configs/base_config.py", line 53, in setup return self._target(self, kwargs) File "/home/sion/miniconda3/envs/nerfstudio/lib/python3.8/site-packages/splatfactow/splatfactow_model.py", line 236, in init super().init(*args, **kwargs) File "/home/sion/nerfstudio/nerfstudio/models/base_model.py", line 85, in init self.populate_modules() # populate the modules File "/home/sion/miniconda3/envs/nerfstudio/lib/python3.8/site-packages/splatfactow/splatfactow_model.py", line 268, in populate_modules torch.zeros((num_points, 3), device=self.device) File "/home/sion/miniconda3/envs/nerfstudio/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1695, in getattr raise AttributeError(f"'{type(self).name}' object has no attribute '{name}'") AttributeError: 'SplatfactoWModel' object has no attribute 'device'

KevinXu02 commented 2 months ago

It looks like the 3d points are not loaded in this case, I will make a commit fixing this. However, the current model is likely to be too large for general simple cases and I do not recommand using the default config. I'm optimizing the model and hopefully I can make it lightweight enough and can be used along with splatfacto. Thank you for catching this.

sion3951 commented 2 months ago

It looks amazing, cant wait for it to be working. Thanks for your help, cant wait to keep testing it!