Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support nested args syntax in cmdline #1095

Open
bouthilx opened this issue Mar 30, 2023 · 0 comments
Open

Support nested args syntax in cmdline #1095

bouthilx opened this issue Mar 30, 2023 · 0 comments
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@bouthilx
Copy link
Member

An argument such as orion hunt python script.py --nested.arg someprior() would cause a keyerror issue during experiment build:

$ orion -vv hunt -n v0.6 --config=orion.yaml python train.py --optim.lr="orion~loguniform(1e-2, 1e-4)"
2023-01-06 15:37:05,797::DEBUG::orion.core.cli.base::Orion version : 0.2.6
...
Traceback (most recent call last):
  File "/Users/user/.pyenv/versions/3.9.2/bin/orion", line 8, in <module>
    sys.exit(main())
  File "/Users/user/.pyenv/versions/3.9.2/lib/python3.9/site-packages/orion/core/cli/__init__.py", line 36, in main
    return orion_parser.execute(argv)
  File "/Users/user/.pyenv/versions/3.9.2/lib/python3.9/site-packages/orion/core/cli/base.py", line 110, in execute
    returncode = function(args)
  File "/Users/user/.pyenv/versions/3.9.2/lib/python3.9/site-packages/orion/core/cli/hunt.py", line 192, in main
    experiment = experiment_builder.build_from_args(args)
  File "/Users/user/.pyenv/versions/3.9.2/lib/python3.9/site-packages/orion/core/io/experiment_builder.py", line 366, in build_from_args
    return builder.build(**cmd_config)
  File "/Users/user/.pyenv/versions/3.9.2/lib/python3.9/site-packages/orion/core/io/experiment_builder.py", line 515, in build
    config = self.consolidate_config(name, version, config)
  File "/Users/user/.pyenv/versions/3.9.2/lib/python3.9/site-packages/orion/core/io/experiment_builder.py", line 733, in consolidate_config
    resolve_config.update_metadata(config["metadata"])
  File "/Users/user/.pyenv/versions/3.9.2/lib/python3.9/site-packages/orion/core/io/resolve_config.py", line 310, in update_metadata
    cmdline_parser.set_state_dict(metadata["parser"])
  File "/Users/user/.pyenv/versions/3.9.2/lib/python3.9/site-packages/orion/core/io/orion_cmdline_parser.py", line 134, in set_state_dict
    self.infer_user_script(self.parser.format(self.parser.arguments))
  File "/Users/user/.pyenv/versions/3.9.2/lib/python3.9/site-packages/orion/core/io/cmdline_parser.py", line 109, in format
end(item.format(**configuration))
KeyError: 'nested'

It should be supoprted, just like we support nested arguments in config.

@bouthilx bouthilx added the bug Indicates an unexpected problem or unintended behavior label Mar 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

1 participant