Update lightning_module_template.py
This commit is contained in:
parent
c5c03c87db
commit
3a2466258d
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue