ayaanzhaque / instruct-nerf2nerf

Instruct-NeRF2NeRF: Editing 3D Scenes with Instructions (ICCV 2023)
https://instruct-nerf2nerf.github.io/
MIT License
769 stars 64 forks source link

TypeError: __init__() takes 2 positional arguments but 3 were given #71

Closed Iliceth closed 8 months ago

Iliceth commented 8 months ago

This might be a very obvious mistake on my end, as I'm quite a newbie, but when I run this command (following the instructions, I believe):

ns-train in2n-tiny --data C:\Users\Andy\Documents\instruct-nerf2nerf\data\nerfstudio\poster --load-dir C:\Users\Andy\Documents\instruct-nerf2nerf\outputs\poster\nerfacto\2023-10-31_182146\nerfstudio_models --pipeline.prompt "make it snowy" --pipeline.guidance-scale 7.5 --pipeline.image-guidance-scale 1.5

This is the "result":

Saving config to: outputs\poster\in2n\2023-10-31_193048\config.yml                   experiment_config.py:141
Saving checkpoints to: outputs\poster\in2n\2023-10-31_193048\nerfstudio_models                 trainer.py:134
Auto image downscale factor of 2                                                 nerfstudio_dataparser.py:349
Setting up training dataset...
Caching all 204 images.

Traceback (most recent call last):
  File "C:\Users\Andy\Anaconda3\envs\instruct_nerf2nerf\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\Andy\Anaconda3\envs\instruct_nerf2nerf\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\Andy\Anaconda3\envs\instruct_nerf2nerf\Scripts\ns-train.exe\__main__.py", line 7, in <module>
  File "C:\Users\Andy\Documents\nerfstudio\nerfstudio\scripts\train.py", line 262, in entrypoint
    main(
  File "C:\Users\Andy\Documents\nerfstudio\nerfstudio\scripts\train.py", line 247, in main
    launch(
  File "C:\Users\Andy\Documents\nerfstudio\nerfstudio\scripts\train.py", line 189, in launch
    main_func(local_rank=0, world_size=world_size, config=config)
  File "C:\Users\Andy\Documents\nerfstudio\nerfstudio\scripts\train.py", line 99, in train_loop
    trainer.setup()
  File "C:\Users\Andy\Documents\nerfstudio\nerfstudio\engine\trainer.py", line 147, in setup
    self.pipeline = self.config.pipeline.setup(
  File "C:\Users\Andy\Documents\nerfstudio\nerfstudio\configs\base_config.py", line 54, in setup
    return self._target(self, **kwargs)
  File "C:\Users\Andy\Documents\instruct-nerf2nerf\in2n\in2n_pipeline.py", line 75, in __init__
    super().__init__(config, device, test_mode, world_size, local_rank)
  File "C:\Users\Andy\Documents\nerfstudio\nerfstudio\pipelines\base_pipeline.py", line 264, in __init__
    self.datamanager: DataManager = config.datamanager.setup(
  File "C:\Users\Andy\Documents\nerfstudio\nerfstudio\configs\base_config.py", line 54, in setup
    return self._target(self, **kwargs)
  File "C:\Users\Andy\Documents\nerfstudio\nerfstudio\data\datamanagers\base_datamanager.py", line 428, in __init__
    super().__init__()
  File "C:\Users\Andy\Documents\nerfstudio\nerfstudio\data\datamanagers\base_datamanager.py", line 189, in __init__
    self.setup_train()
  File "C:\Users\Andy\Documents\instruct-nerf2nerf\in2n\in2n_datamanager.py", line 67, in setup_train
    self.train_ray_generator = RayGenerator(
TypeError: __init__() takes 2 positional arguments but 3 were given

Is there anything wrong with my command or is something else at fault?

Thanks for your help!

lsongx commented 8 months ago

Hi @Iliceth , you can try this updated branch https://github.com/lsongx/instruct-nerf2nerf/tree/update-camera-optimizer I submitted a PR, but seems that the authors are too busy to look into it

ayaanzhaque commented 8 months ago

Sorry I just merged that PR, for some reason I didn't receive a notification about it. Resolved, thanks!

Iliceth commented 8 months ago

Hi @Iliceth , you can try this updated branch https://github.com/lsongx/instruct-nerf2nerf/tree/update-camera-optimizer I submitted a PR, but seems that the authors are too busy to look into it

Thanks. Sorry for the stupid question, but I'm supposed to overwrite the original files with those? If so, I did that to a copy and tested it, but the exact same issue persists.

ayaanzhaque commented 8 months ago

Just do git pull and pull the most recent version of the code. If you pip installed, just redo the pip install

lsongx commented 8 months ago

You can simply git pull now. The PR has now been merged.

Iliceth commented 8 months ago

Perfect, thanks!