From 65b838f4097e2aff947cf0e083c0e19dc53c776e Mon Sep 17 00:00:00 2001 From: allegroai <> Date: Wed, 19 May 2021 15:25:47 +0300 Subject: [PATCH] Fix Hydra should not store the full resolved OmegaConf (issue #327) --- clearml/binding/hydra_bind.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/clearml/binding/hydra_bind.py b/clearml/binding/hydra_bind.py index 586240a6..8f3fa65b 100644 --- a/clearml/binding/hydra_bind.py +++ b/clearml/binding/hydra_bind.py @@ -113,7 +113,7 @@ class PatchHydra(object): pre_app_task_init_call = bool(PatchHydra._current_task) - if pre_app_task_init_call: + if pre_app_task_init_call and not running_remotely(): LoggerRoot.get_base_logger(PatchHydra).info( 'Task.init called outside of Hydra-App. For full Hydra multi-run support, ' 'move the Task.init call into the Hydra-App main function') @@ -158,11 +158,15 @@ class PatchHydra(object): description = 'Full OmegaConf YAML configuration overridden! ({}/{}=True)'.format( PatchHydra._parameter_section, PatchHydra._parameter_allow_full_edit) + # we should not have the hydra section in the config, but this seems never to be the case anymore. + # config = config.copy() + # config.pop('hydra', None) + configuration = dict( name=PatchHydra._config_section, description=description, config_type='OmegaConf YAML', - config_text=OmegaConf.to_yaml({k: v for k, v in config.items() if k not in ('hydra', )}) + config_text=OmegaConf.to_yaml(config, resolve=False) ) if PatchHydra._current_task: # noinspection PyProtectedMember