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

multirun override for structured config parameter whose group is set by defaults does not work #726

Closed
immanuelweber opened this issue Jun 27, 2020 · 5 comments · Fixed by #732
Labels
bug Something isn't working
Milestone

Comments

@immanuelweber
Copy link

🐛 Bug

I have a few structured config classes, which I use mainly as verification schemes.
I define defaults for the corresponding groups in the main config.yaml
Now if I want to do a multi-run over a parameter from these groups, it crashes and it appears that hydra is unable to split the multiple values for that parameter.
The following small example shows that behavior. However, I found out that if I add the group to main config.yaml (the commented config lines below) then it works as expected.

To reproduce

conf/config.yaml:

defaults:
  - test: default

# test:
#   param: 0

conf/test/default.yaml:

# @package _group_
param: 10

test.py:

from dataclasses import dataclass

import hydra
from hydra.core.config_store import ConfigStore
from omegaconf import MISSING, DictConfig


@dataclass
class TestConfig:
    param: int = MISSING


config_store = ConfigStore.instance()
config_store.store(group="test", name="default", node=TestConfig)


@hydra.main(config_path="conf", config_name="config")
def run(config: DictConfig):
    print(config.pretty())


if __name__ == "__main__":
    run()

** Stack trace/error message **

test.py -m test.param=42,23 
Error merging override test.param=42,23
Value '42,23' could not be converted to Integer
        full_key: test.param
        reference_type=Optional[TestConfig]
        object_type=TestConfig

Expected Behavior

do multirun for values 42 and 23

System information

  • Hydra Version : 1.0.0.rc1
  • Python version : Python 3.8.3
  • Virtual environment type and version : conda 4.8.3
  • Operating system : ubuntu 18.04

Additional context

Add any other context about the problem here.

@immanuelweber immanuelweber added the bug Something isn't working label Jun 27, 2020
@omry
Copy link
Collaborator

omry commented Jun 27, 2020

Thanks for reporting, I will take a look.
in the mean time, can you:

  1. try to repro without structured configs.
  2. Test your minimal example from 1 on both 0.11 and 1.0?

@immanuelweber
Copy link
Author

the answer for 1. I could have given in the first post, sorry: it does work when I do not store the corresponding structured config class.
I Will answer 2. later.

@immanuelweber
Copy link
Author

ok, and the answer for 2. is obvious: it works as well.
So without structured configs the example both works on 0.11 and 1.0rc.

@immanuelweber
Copy link
Author

it works, thanks a lot!

@omry
Copy link
Collaborator

omry commented Jun 30, 2020

awesome, thanks for for testing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants