nerfstudio icon indicating copy to clipboard operation
nerfstudio copied to clipboard

Pynerf - TypeError: __init__() takes 2 positional arguments but 3 were given - Error

Open JamesAscroft opened this issue 1 year ago • 3 comments

Describe the bug When attempting to train a data set with Pynerf. I persistently get this issue.

[https://docs.nerf.studio/nerfology/methods/pynerf.html]

ns-train pynerf nerfstudio-data --data data/nerfstudio/Egypt


Traceback (most recent call last): File "C:\Users\James\anaconda3\envs\nerfstudio\lib\runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\James\anaconda3\envs\nerfstudio\lib\runpy.py", line 87, in run_code exec(code, run_globals) File "C:\Users\James\anaconda3\envs\nerfstudio\Scripts\ns-train.exe_main.py", line 7, in File "C:\Users\James\anaconda3\envs\nerfstudio\lib\site-packages\nerfstudio\scripts\train.py", line 262, in entrypoint main( File "C:\Users\James\anaconda3\envs\nerfstudio\lib\site-packages\nerfstudio\scripts\train.py", line 247, in main launch( File "C:\Users\James\anaconda3\envs\nerfstudio\lib\site-packages\nerfstudio\scripts\train.py", line 189, in launch main_func(local_rank=0, world_size=world_size, config=config) File "C:\Users\James\anaconda3\envs\nerfstudio\lib\site-packages\nerfstudio\scripts\train.py", line 99, in train_loop trainer.setup() File "C:\Users\James\anaconda3\envs\nerfstudio\lib\site-packages\nerfstudio\engine\trainer.py", line 149, in setup self.pipeline = self.config.pipeline.setup( File "C:\Users\James\anaconda3\envs\nerfstudio\lib\site-packages\nerfstudio\configs\base_config.py", line 54, in setup return self._target(self, **kwargs) File "C:\Users\James\anaconda3\envs\nerfstudio\lib\site-packages\nerfstudio\pipelines\base_pipeline.py", line 254, in init self.datamanager: DataManager = config.datamanager.setup( File "C:\Users\James\anaconda3\envs\nerfstudio\lib\site-packages\nerfstudio\configs\base_config.py", line 54, in setup return self._target(self, **kwargs) File "C:\Users\James\anaconda3\envs\nerfstudio\lib\site-packages\pynerf\data\datamanagers\random_subset_datamanager.py", line 96, in init self.train_ray_generator = RayGenerator(self.train_dataparser_outputs.cameras.to(self.device), TypeError: init() takes 2 positional arguments but 3 were given

JamesAscroft avatar Mar 15 '24 12:03 JamesAscroft

Problem is external to Nerfstudio in this example. The issue is that the latest versions of Nerfstudio have updated their calls to certain classes, like datamanagers, however, the maintainers of the PyNerf repo have not, from my understanding, updated their code to reflect some of these changes. The problem is basically they expect their code to work for all versions of nerfstudio above this but I guess at some point the nerfstudio version and their repo clashes.

maturk avatar Mar 15 '24 13:03 maturk

Ah okay, so it's a waiting game for PyNerf to update things from their end. Thanks again!

JamesAscroft avatar Mar 15 '24 13:03 JamesAscroft

https://github.com/hturki/pynerf/issues/6

Found this issue topic open on PyNerf's page for anyone else struggling

JamesAscroft avatar Mar 15 '24 14:03 JamesAscroft