Skip to content

Commit

Permalink
Add config to tensorboard writer
Browse files Browse the repository at this point in the history
  • Loading branch information
kks32 committed Jun 26, 2024
1 parent c6b092d commit 14f3b9e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions gns/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,8 +425,9 @@ def train(rank, cfg, world_size, device):
if rank == 0 or device == torch.device("cpu"):
writer = SummaryWriter(log_dir=cfg.logging.tensorboard_dir)

writer.add_text("Data path", cfg.data.path)
writer.add_text("metadata", json.dumps(metadata, indent=4))
yaml_config = OmegaConf.to_yaml(cfg)
writer.add_text("Config", yaml_config, global_step=0)

# Log hyperparameters
hparam_dict = {
Expand Down Expand Up @@ -751,9 +752,6 @@ def main(cfg: Config):
os.environ["MASTER_ADDR"] = "localhost"
os.environ["MASTER_PORT"] = "29500"

# Print the final configuration
print(OmegaConf.to_yaml(cfg))

if cfg.mode == "train":
# If model_path does not exist create new directory.
if not os.path.exists(cfg.model.path):
Expand Down

0 comments on commit 14f3b9e

Please sign in to comment.