Skip to content

Commit

Permalink
Ensure sync across val/test step when using DDP (#371)
Browse files Browse the repository at this point in the history
* Ensure sync across val/test step when using DDP

* Remove sync_dist from class metrics as they are automatically reduced
  • Loading branch information
SeanNaren authored Nov 17, 2020
1 parent b746be0 commit a44de3c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pl_bolts/models/self_supervised/ssl_finetuner.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def validation_step(self, batch, batch_idx):
loss, logits, y = self.shared_step(batch)
acc = self.val_acc(logits, y)

self.log('val_loss', loss, prog_bar=True)
self.log('val_loss', loss, prog_bar=True, sync_dist=True)
self.log('val_acc', self.val_acc)

return loss
Expand All @@ -114,7 +114,7 @@ def test_step(self, batch, batch_idx):
loss, logits, y = self.shared_step(batch)
acc = self.test_acc(logits, y)

self.log('test_loss', loss)
self.log('test_loss', loss, sync_dist=True)
self.log('test_acc', self.test_acc)

return loss
Expand Down

0 comments on commit a44de3c

Please sign in to comment.