coltonstearns / dynamic-gaussian-marbles

MIT License
109 stars 9 forks source link

Cannot load config in ns-viewer #9

Open rhodriguerrier opened 1 week ago

rhodriguerrier commented 1 week ago

Hi @coltonstearns, I am trying to load the config produced by the model in ns-viewer so I can look at some custom views. However, I get the following error:

(dgmarbles) cibo@cibo:~/Rhodri/dynamic-gaussian-marbles$ ns-viewer --load-config out/P01_09_start_150761_end_150875/gsplatting/2024-10-09_161432/config.yml
Traceback (most recent call last):
  File "/home/cibo/anaconda3/envs/dgmarbles/lib/python3.10/site-packages/yaml/constructor.py", line 551, in find_python_name
    __import__(module_name)
ModuleNotFoundError: No module named 'src'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/cibo/anaconda3/envs/dgmarbles/bin/ns-viewer", line 8, in <module>
    sys.exit(entrypoint())
  File "/home/cibo/anaconda3/envs/dgmarbles/lib/python3.10/site-packages/nerfstudio/scripts/viewer/run_viewer.py", line 133, in entrypoint
    tyro.cli(tyro.conf.FlagConversionOff[RunViewer]).main()
  File "/home/cibo/anaconda3/envs/dgmarbles/lib/python3.10/site-packages/nerfstudio/scripts/viewer/run_viewer.py", line 63, in main
    config, pipeline, _, step = eval_setup(
  File "/home/cibo/anaconda3/envs/dgmarbles/lib/python3.10/site-packages/nerfstudio/utils/eval_utils.py", line 88, in eval_setup
    config = yaml.load(config_path.read_text(), Loader=yaml.Loader)
  File "/home/cibo/anaconda3/envs/dgmarbles/lib/python3.10/site-packages/yaml/__init__.py", line 81, in load
    return loader.get_single_data()
  File "/home/cibo/anaconda3/envs/dgmarbles/lib/python3.10/site-packages/yaml/constructor.py", line 51, in get_single_data
    return self.construct_document(node)
  File "/home/cibo/anaconda3/envs/dgmarbles/lib/python3.10/site-packages/yaml/constructor.py", line 55, in construct_document
    data = self.construct_object(node)
  File "/home/cibo/anaconda3/envs/dgmarbles/lib/python3.10/site-packages/yaml/constructor.py", line 105, in construct_object
    data = next(generator)
  File "/home/cibo/anaconda3/envs/dgmarbles/lib/python3.10/site-packages/yaml/constructor.py", line 617, in construct_python_object
    instance = self.make_python_instance(suffix, node, newobj=True)
  File "/home/cibo/anaconda3/envs/dgmarbles/lib/python3.10/site-packages/yaml/constructor.py", line 722, in make_python_instance
    return super(UnsafeConstructor, self).make_python_instance(
  File "/home/cibo/anaconda3/envs/dgmarbles/lib/python3.10/site-packages/yaml/constructor.py", line 585, in make_python_instance
    cls = self.find_python_name(suffix, node.start_mark)
  File "/home/cibo/anaconda3/envs/dgmarbles/lib/python3.10/site-packages/yaml/constructor.py", line 719, in find_python_name
    return super(UnsafeConstructor, self).find_python_name(name, mark, unsafe=True)
  File "/home/cibo/anaconda3/envs/dgmarbles/lib/python3.10/site-packages/yaml/constructor.py", line 553, in find_python_name
    raise ConstructorError("while constructing a Python object", mark,
yaml.constructor.ConstructorError: while constructing a Python object
cannot find module 'src.models.trainer' (No module named 'src')
  in "<unicode string>", line 1, column 1:
    !!python/object:src.models.train ...
    ^

Do you know how I could fix this? Thanks

coltonstearns commented 1 week ago

Hello, thanks for bringing this up! While we build off many parts of NerfStudio (including their visualizer), our code does not support their CLI commands. I apologize for the confusion, and will clarify this in the README. Also, I currently don't have a script for interactively viewing trained models - I will also add this in the next couple days.

In the meantime, a quick "hack" to get interactive viewing on the pretrained models:

Let me know if you have any questions!

rhodriguerrier commented 1 week ago

Hi @coltonstearns, thank you so much for the quick reply! That works an absolute treat! I had to edit the camera paths json slightly as the ns-render command doesn't work either but I've now got exactly what I was looking for so really thank you for this!