variable interpolation failing on diffrerent structure #2732
-
good morning, i was wondering some help if posible on understanding why these is not working, i have the following project structure
some snip of the code:
---
defaults:
- _self_
- /parsers/parser_1
parameters:
algo: 7
---
_target_: utils.make_pipeline
_recursive_: False
steps_config:
- load:
_target_: common_steps.F1
- transform:
_target_: common_steps.F2
algo: ${parameters.algo}
@hydra.main(version_base="1.1", config_path="config", config_name=end_settings)
def my_app(cfg: DictConfig) -> None:
print(OmegaConf.to_yaml(cfg))
my_app() the end result of parameters:
algo: 7
parsers:
_target_: utils.make_pipeline
_recursive_: false
steps_config:
- load:
_target_: common_steps.F1
- transform:
_target_: common_steps.F2
algo: ${parameters.algo} i don't get why the parameters:
algo: 7
parsers:
_target_: utils.make_pipeline
_recursive_: false
steps_config:
- load:
_target_: common_steps.F1
- transform:
_target_: common_steps.F2
algo: 7 thanks in advance and i really appreciate any help |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Not sure I understand the problem, is it just that you should add |
Beta Was this translation helpful? Give feedback.
-
OmegaConf interpolations are evaluated on access. When you convert to yaml, by default the interpolation "pointer" is preserved. |
Beta Was this translation helpful? Give feedback.
Not sure I understand the problem, is it just that you should add
resolve=True
when callingto_yaml()
?