From 6afd64b15f2832774a077638135bb622279e7356 Mon Sep 17 00:00:00 2001 From: peterdudfield Date: Tue, 11 Jun 2024 10:42:27 +0100 Subject: [PATCH 1/4] save configuration to wandb --- pvnet/training.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pvnet/training.py b/pvnet/training.py index cc5f3c43..a95f6acd 100644 --- a/pvnet/training.py +++ b/pvnet/training.py @@ -121,6 +121,14 @@ def train(config: DictConfig) -> Optional[float]: assert os.path.isfile(data_config), f"Data config file not found: {data_config}" shutil.copyfile(data_config, f"{callback.dirpath}/data_config.yaml") + + # upload configuration up to wandb + os.makedirs("./configuration", exist_ok=True) + shutil.copyfile(data_config, f"./configuration/data_config.yaml") + OmegaConf.save(config, f"./configuration/config.yaml") + wandb_logger.experiment.save(f"./configuration/data_config.yaml") + wandb_logger.experiment.save(f"./configuration/config.yaml") + break should_pretrain = False From dc6adeb628ac104a8fd100114b2774450fd60dc0 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 11 Jun 2024 09:44:57 +0000 Subject: [PATCH 2/4] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- pvnet/training.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pvnet/training.py b/pvnet/training.py index a95f6acd..f0e64caf 100644 --- a/pvnet/training.py +++ b/pvnet/training.py @@ -124,10 +124,10 @@ def train(config: DictConfig) -> Optional[float]: # upload configuration up to wandb os.makedirs("./configuration", exist_ok=True) - shutil.copyfile(data_config, f"./configuration/data_config.yaml") - OmegaConf.save(config, f"./configuration/config.yaml") - wandb_logger.experiment.save(f"./configuration/data_config.yaml") - wandb_logger.experiment.save(f"./configuration/config.yaml") + shutil.copyfile(data_config, "./configuration/data_config.yaml") + OmegaConf.save(config, "./configuration/config.yaml") + wandb_logger.experiment.save("./configuration/data_config.yaml") + wandb_logger.experiment.save("./configuration/config.yaml") break From 5e7bb3c2e6256daca3704307b74012b027bebbe6 Mon Sep 17 00:00:00 2001 From: peterdudfield Date: Tue, 11 Jun 2024 13:53:34 +0100 Subject: [PATCH 3/4] save to top level wandb folder --- pvnet/training.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pvnet/training.py b/pvnet/training.py index a95f6acd..f41749d0 100644 --- a/pvnet/training.py +++ b/pvnet/training.py @@ -123,11 +123,9 @@ def train(config: DictConfig) -> Optional[float]: shutil.copyfile(data_config, f"{callback.dirpath}/data_config.yaml") # upload configuration up to wandb - os.makedirs("./configuration", exist_ok=True) - shutil.copyfile(data_config, f"./configuration/data_config.yaml") - OmegaConf.save(config, f"./configuration/config.yaml") - wandb_logger.experiment.save(f"./configuration/data_config.yaml") - wandb_logger.experiment.save(f"./configuration/config.yaml") + OmegaConf.save(config, f"./experiment_config.yaml") + wandb_logger.experiment.save(f"{callback.dirpath}/data_config.yaml", callback.dirpath) + wandb_logger.experiment.save(f"./experiment_config.yaml") break From 15024a917150005a1aa9f972722caa31e970f4a3 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 11 Jun 2024 12:54:36 +0000 Subject: [PATCH 4/4] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- pvnet/training.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pvnet/training.py b/pvnet/training.py index 591446da..cafcdac4 100644 --- a/pvnet/training.py +++ b/pvnet/training.py @@ -124,7 +124,9 @@ def train(config: DictConfig) -> Optional[float]: # upload configuration up to wandb OmegaConf.save(config, "./experiment_config.yaml") - wandb_logger.experiment.save(f"{callback.dirpath}/data_config.yaml", callback.dirpath) + wandb_logger.experiment.save( + f"{callback.dirpath}/data_config.yaml", callback.dirpath + ) wandb_logger.experiment.save("./experiment_config.yaml") break