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

Copy extra_init_params to get rid of recursive config dicts #316

Merged
merged 6 commits into from
Feb 3, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions composer/loggers/logger_hparams.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,10 @@ def get_flattened_dict(data: Dict[str, Any], _prefix: List[str] = []) -> Dict[st
all_items[key_name] = val
return all_items

# extra_init_params may be in ``config`` already. Copy it so we don't get recursive dicts.
self.extra_init_params = copy.deepcopy(self.extra_init_params)
if self.flatten_hparams:
config = get_flattened_dict(data=config)
else:
config = copy.deepcopy(config) # Copy since WandB parameters are part of config

if "config" not in self.extra_init_params:
self.extra_init_params["config"] = {}
if not isinstance(self.extra_init_params["config"], dict):
Expand Down