From b25c07af1986a73c2b129bfdcbefbc1dceef1885 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sun, 19 Sep 2021 21:06:22 +0200 Subject: Add save of config to runs directory --- training/utils.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'training/utils.py') diff --git a/training/utils.py b/training/utils.py index d23396e..6f57e4d 100644 --- a/training/utils.py +++ b/training/utils.py @@ -17,7 +17,14 @@ from tqdm import tqdm import wandb +def save_config(config: DictConfig) -> None: + """Save config to experiment directory.""" + with open("config.yaml", "w") as f: + OmegaConf.save(config, f=f) + + def print_config(config: DictConfig) -> None: + """Prints config.""" print(OmegaConf.to_yaml(config)) -- cgit v1.2.3-70-g09d2