Skip to content

Commit

Permalink
fix tensorboard error (jpata#254)
Browse files Browse the repository at this point in the history
* fix tensorboard error

* suppress warning

* remove enviornment variable

* Update pyg_pipeline.py

---------

Co-authored-by: Joosep Pata <[email protected]>
  • Loading branch information
farakiko and jpata authored Oct 25, 2023
1 parent 370f47f commit 38d2e59
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mlpf/pyg/training.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,10 +370,10 @@ def train_mlpf(rank, world_size, model, optimizer, train_loader, valid_loader, n
# with record_function("model_train"):
# print(prof.key_averages().table(sort_by="cuda_time_total", row_limit=20))

for k, v in losses_t.items():
tensorboard_writer.add_scalar(f"epoch/train_loss_rank_{rank}_" + k, v, epoch)

if (rank == 0) or (rank == "cpu"):
for k, v in losses_t.items():
tensorboard_writer.add_scalar("epoch/train_loss_" + k, v, epoch)

for loss in losses_of_interest:
losses["train"][loss].append(losses_t[loss])
losses["valid"][loss].append(losses_v[loss])
Expand Down

0 comments on commit 38d2e59

Please sign in to comment.