From 3a2466258d982653c256f7eccda0291190a3a865 Mon Sep 17 00:00:00 2001 From: William Falcon Date: Wed, 23 Oct 2019 04:31:58 -0400 Subject: [PATCH] Update lightning_module_template.py --- pl_examples/basic_examples/lightning_module_template.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pl_examples/basic_examples/lightning_module_template.py b/pl_examples/basic_examples/lightning_module_template.py index f773fc81a3..6b58ab46ef 100644 --- a/pl_examples/basic_examples/lightning_module_template.py +++ b/pl_examples/basic_examples/lightning_module_template.py @@ -158,7 +158,7 @@ class LightningTemplateModel(LightningModule): val_loss = output['val_loss'] # reduce manually when using dp - if self.trainer.use_dp: + if self.trainer.use_dp or self.trainer.use_ddp2: val_loss = torch.mean(val_loss) val_loss_mean += val_loss