Skip to content

Commit

Permalink
set sync dist
Browse files Browse the repository at this point in the history
  • Loading branch information
ashleve committed May 2, 2023
1 parent 8919406 commit a9c8bce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/models/mnist_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def on_validation_epoch_end(self):
self.val_acc_best(acc) # update best so far val acc
# log `val_acc_best` as a value through `.compute()` method, instead of as a metric object
# otherwise metric would be reset by lightning after each epoch
self.log("val/acc_best", self.val_acc_best.compute(), prog_bar=True)
self.log("val/acc_best", self.val_acc_best.compute(), sync_dist=True, prog_bar=True)

def test_step(self, batch: Any, batch_idx: int):
loss, preds, targets = self.model_step(batch)
Expand Down

0 comments on commit a9c8bce

Please sign in to comment.