facebookresearch / pytorch3d

PyTorch3D is FAIR's library of reusable components for deep learning with 3D data
https://pytorch3d.org/
Other
8.75k stars 1.31k forks source link

ConfigKeyError while visualizeing the trained Implicitron_trainer model. #1345

Open sangjjang96 opened 2 years ago

sangjjang96 commented 2 years ago

If you do not know the root cause of the problem / bug, and wish someone to help you, please post according to this template:

🐛 Bugs / Unexpected behaviors

NOTE: Please look at the existing list of Issues tagged with the label 'bug`. Only open a new issue if this bug has not already been reported. If an issue already exists, please comment there instead..

Instructions To Reproduce the Issue:

Please include the following (depending on what the issue is):

Hi !

I'd like to visualize the trained model on CO3D dataset of implicitron-trainer but error came out.

  1. Any changes you made (git diff) or code you wrote
    
    diff --git a/projects/implicitron_trainer/experiment.py b/projects/implicitron_trainer/experiment.py
    index a033251..6915b85 100755
    --- a/projects/implicitron_trainer/experiment.py
    +++ b/projects/implicitron_trainer/experiment.py
    @@ -76,10 +76,15 @@ from pytorch3d.implicitron.tools.config import (
     run_auto_creation,
    )

-from .impl.model_factory import ModelFactoryBase -from .impl.optimizer_factory import OptimizerFactoryBase -from .impl.training_loop import TrainingLoopBase -from .impl.utils import seed_all_random_engines +# from .impl.model_factory import ModelFactoryBase +# from .impl.optimizer_factory import OptimizerFactoryBase +# from .impl.training_loop import TrainingLoopBase +# from .impl.utils import seed_all_random_engines + +from impl.model_factory import ModelFactoryBase +from impl.optimizer_factory import OptimizerFactoryBase +from impl.training_loop import TrainingLoopBase +from impl.utils import seed_all_random_engines

logger = logging.getLogger(name)

diff --git a/projects/implicitron_trainer/visualize_reconstruction.py b/projects/implicitron_trainer/visualize_reconstruction.py index e79ecb6..e0439ba 100644 --- a/projects/implicitron_trainer/visualize_reconstruction.py +++ b/projects/implicitron_trainer/visualize_reconstruction.py

2. The exact command(s) you ran: 

python visualize_reconstruction.py exp_dir='/home/kmuvcl/p3d/pytorch3d/projects/implicitron_trainer/data/exps/base/' \ visdom_show_preds=True n_eval_cameras=40 render_size="[64,64]" video_size="[256,256]"

3. What you observed (including the full logs):

/home/kmuvcl/p3d/pytorch3d/projects/implicitron_trainer/experiment.py:289: UserWarning: The version_base parameter is not specified. Please specify a compatability version level, or None. Will assume defaults for version 1.1 @hydra.main(config_path="./configs/", config_name="default_config") Traceback (most recent call last): File "visualize_reconstruction.py", line 156, in main(sys.argv) File "visualize_reconstruction.py", line 150, in main cfg.update(OmegaConf.from_cli(argv)) File "/home/kmuvcl/anaconda3/envs/p3d/lib/python3.8/_collections_abc.py", line 832, in update self[key] = other[key] File "/home/kmuvcl/anaconda3/envs/p3d/lib/python3.8/site-packages/omegaconf/dictconfig.py", line 310, in setitem self._format_and_raise( File "/home/kmuvcl/anaconda3/envs/p3d/lib/python3.8/site-packages/omegaconf/base.py", line 231, in _format_and_raise format_and_raise( File "/home/kmuvcl/anaconda3/envs/p3d/lib/python3.8/site-packages/omegaconf/_utils.py", line 820, in format_and_raise _raise(ex, cause) File "/home/kmuvcl/anaconda3/envs/p3d/lib/python3.8/site-packages/omegaconf/_utils.py", line 798, in _raise raise ex.with_traceback(sys.exc_info()[2]) # set env var OC_CAUSE=1 for full trace File "/home/kmuvcl/anaconda3/envs/p3d/lib/python3.8/site-packages/omegaconf/dictconfig.py", line 308, in setitem self.__set_impl(key=key, value=value) File "/home/kmuvcl/anaconda3/envs/p3d/lib/python3.8/site-packages/omegaconf/dictconfig.py", line 318, in __set_impl self._set_item_impl(key, value) File "/home/kmuvcl/anaconda3/envs/p3d/lib/python3.8/site-packages/omegaconf/basecontainer.py", line 543, in _set_item_impl self._validate_set(key, value) File "/home/kmuvcl/anaconda3/envs/p3d/lib/python3.8/site-packages/omegaconf/dictconfig.py", line 180, in _validate_set target = self._get_node(key) if key is not None else self File "/home/kmuvcl/anaconda3/envs/p3d/lib/python3.8/site-packages/omegaconf/dictconfig.py", line 475, in _get_node self._validate_get(key) File "/home/kmuvcl/anaconda3/envs/p3d/lib/python3.8/site-packages/omegaconf/dictconfig.py", line 164, in _validate_get self._format_and_raise( File "/home/kmuvcl/anaconda3/envs/p3d/lib/python3.8/site-packages/omegaconf/base.py", line 231, in _format_and_raise format_and_raise( File "/home/kmuvcl/anaconda3/envs/p3d/lib/python3.8/site-packages/omegaconf/_utils.py", line 900, in format_and_raise _raise(ex, cause) File "/home/kmuvcl/anaconda3/envs/p3d/lib/python3.8/site-packages/omegaconf/_utils.py", line 798, in _raise raise ex.with_traceback(sys.exc_info()[2]) # set env var OC_CAUSE=1 for full trace omegaconf.errors.ConfigKeyError: Key 'visualize_reconstruction' not in '_visualize_reconstruction_defaultargs' full_key: visualize_reconstruction object_type=_visualize_reconstruction_defaultargs



Please also simplify the steps as much as possible so they do not require additional resources to
   run, such as a private dataset.
bottler commented 2 years ago

If you've got pytorch3d installed, it should be easiest to run pytorch3d_implicitron_visualizer <args...> instead of going in to the directory and typing python visualize_reconstruction.py <args...>. Or alternatively run it with python -m ...

sangjjang96 commented 2 years ago

@bottler I tried using pytorch3d_implicitron_visualizer exp_dir='data/exps/base/' visdom_show_preds=True n_eval_cameras=40 render_size="[64,64]" video_size="[256,256]" and new error came out.

The version_base parameter is not specified.
Please specify a compatability version level, or None.
Will assume defaults for version 1.1
  @hydra.main(config_path="./configs/", config_name="default_config")
Traceback (most recent call last):
  File "/home/kmuvcl/anaconda3/envs/p3d_local/bin/pytorch3d_implicitron_visualizer", line 8, in <module>
    sys.exit(main())
TypeError: main() missing 1 required positional argument: 'argv'
george66s commented 1 year ago

@bottler

It sounds strange. You guys have published the script of visualize_reconstruction.py, but advising users to go for the CLI. It feels terrible when both methods could not work. Same story happened to the training. We have to dive into the code to make some modifications before the script can be run properly. The CLI training published by you guys certainly doesn't work. It's regrettable. Just wondering if you guys at Facebook can make others' life a little easier. Seems like you are contradicting to yourself. The purpose of your launching of Pytorch3D seems to let people use it. But the way you organize the code seems you do not want anybody to use it.