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

[Feature Request] Add option to replace "/" in hydra.job.override_dirname #3018

Open
stefangstark opened this issue Jan 31, 2025 · 0 comments

Comments

@stefangstark
Copy link

If overrides contain a / then a subdirectory is created when using hydra.job.override_dirname. The referenced discussion suggests to write a custom function that replaces instances of /. However, it would be convenient if this was done using a mechanism similar to e.g. hydra.job.config.override_dirname.kv_sep.

Discussed in #2409

Originally posted by Aceticia October 9, 2022
I'm using the override_dirname as the folder to store checkpoints and logs. This does store the logs, but since my configs contain overrides with /, hydra ended up not treating them as part of the subdir but as a directory under the subdir, creating one redundant level of folder each time I override something. This is a pretty small inconvenience, and it would probably be very difficult to fix (how to differentiate where user actually want a subdirectory but not override?), but I imagine it's not the intended behavior?

For more details, here is how I'm overriding some configs. If there is an alternative where I can just not use / overrides I guess that would solve the issue too.

models
- default.yaml
- temporal_nets
    - net1.yaml
    - net2.yaml

In net1.yaml and net2.yaml, there are configurations for neural networks including __target__ instantiations and their hyperparameters. In default.yaml I simply have a default list of using net1.yaml. When I do need to run an experiment with net2, I just override with models/temporal_nets=net2. What are alternative ways to organize the configs, so that I can override the choice of temporal_nets? Any suggestions would be appreciated. Thank you.

@stefangstark stefangstark changed the title Add option to replace "/" in hydra.job.override_dirname [Feature Request] Add option to replace "/" in hydra.job.override_dirname Feb 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant