question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

🐛 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.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
immanuelwebercommented, Jun 30, 2020

it works, thanks a lot!

1reaction
immanuelwebercommented, Jun 27, 2020

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Multi-run | Hydra
The legal values are RUN and MULTIRUN . The following shows how to override from the command-line and sweep over all combinations of...
Read more >
How to override hydra working dir from within a script?
The @hydra.main decorator reads the command line arguments from sys.argv and creates the output directory and sets up logging based on the ...
Read more >
Modulus Configuration - NVIDIA Documentation Center
This config object has multiple configuration groups that each contain separate parameters pertaining to various features needed inside of Modulus.
Read more >
Plugin Configuration File | IntelliJ Platform Plugin SDK
It should be a fully qualified name similar to Java packages and must not collide with the ID of existing plugins. The ID...
Read more >
1.1.7 (core) / 0.17.7 (libraries) - Dagster Docs
You can no longer set an output's asset key by overriding ... For partitioned asset jobs whose config is a hardcoded dictionary (rather...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found