-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
exp run: --set-param does not override Hydra config parameter #10186
Comments
It's expected but we need to clarify it better in the docs. To have the hydra overrides reflected in your You don't need the from omegaconf import DictConfig
from ruamel.yaml import YAML
def main() -> None:
cfg = DictConfig(YAML(typ="safe").load(open("params.yaml")))
print('max epochs are ', cfg.training.pl_hparams.max_epochs)
if __name__ == "__main__":
main() |
Thank you, @dberenbaum , for the clarification and the suggested workaround. I understand that the current behavior is by design and that the documentation could benefit from additional details on how parameter overrides are handled with Hydra. However, the proposed solution to bypass the Is there a possibility to enhance DVC's compatibility with Hydra's features, specifically to support custom OmegaConf resolvers? This would allow us to utilize --set-param overrides (and usage of the VS code DVC addon as wel;) effectively while maintaining our existing configuration setup. |
Thanks again for the reply @dberenbaum.
I moved my issue to #9731 and added some examples for our custom resolvers. I will close this issue now. |
Bug Report
Description
When using
dvc exp run --set-param
to update a parameter, theparams.yaml
file is updated correctly, but the change is not propagated to the training script when using Hydra for configuration management. Despite theparams.yaml
being updated, the training script executed by DVC uses the default value fromconf/config.yaml
, and the override is not applied.Reproduce
.dvc/config
with the following content:dvc.yaml
with a stage that uses a parameter:train.py
that uses Hydra to load configuration:conf/config.yaml
with the default parameter value:dvc exp run -sf training -S 'training.pl_hparams.max_epochs=41'
.params.yaml
is updated with the newmax_epochs
value.train.py
script still shows the defaultmax_epochs
value fromconf/config.yaml
.Expected
The
dvc exp run --set-param
command should update the parameter inparams.yaml
and ensure that the overridden parameter value is used by the training script when executed by DVC, even when using Hydra for configuration management.Environment information
Output of
dvc doctor
:The text was updated successfully, but these errors were encountered: