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

Overwrite default configuration #582

Closed
isvoboda opened this issue May 9, 2020 · 2 comments
Closed

Overwrite default configuration #582

isvoboda opened this issue May 9, 2020 · 2 comments
Labels
question Hydra usage question

Comments

@isvoboda
Copy link

isvoboda commented May 9, 2020

My use-case includes predefined configuration of an experiment based on the suggestion from #386 (comment)

I do not know how to redefine the selection of group model in defaults:

  • conf/config.yaml
defaults:
  model: UNetPix
  • conf/model/UNetPix.yaml
model:
  class: models.UNet.UNetPix
    params:
      kwarg1: ...
      kwarg2: ...
  • conf/model/UNetTC.yaml
model:
  class: models.UNet.UNetTC
    params:
      kwarg1: ...
      kwarg2: ...

I would like to add configuration of an experiment where the UNetTC node replaces the UNetPix.

  • conf/experiment/UNetTC.yaml
model: UNetTC # Here I would like to replace UNetPix by UNetTC defined in model/UNetTC.yaml
... # other experiment related configurations

I can set the model as model: UNetTC which resolves to string UNetTC but the desired outcome should be the whole node defined in models/UNetTC.yaml.

Is this currently possible?

@omry
Copy link
Collaborator

omry commented May 9, 2020

The only supported way to override the defaults list when using @hydra.main() is through the command line.

python foo.py model=UNetTC

I suspect what you really want would be addressed by the potential support for recursive defaults. but this is not something that will happen soon and I still have some questions about it's viability.

See #171 for the info about the task to add recursive detaults.

@omry omry added the question Hydra usage question label May 9, 2020
@omry
Copy link
Collaborator

omry commented May 9, 2020

An alternative workaround would come once support for an alternative primary config is introduced.
that way you will be able to have a defaults list in your alternative primary config. this is likely be supported before recursive defaults.

@omry omry closed this as completed May 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Hydra usage question
Projects
None yet
Development

No branches or pull requests

2 participants