mirror of
https://github.com/wassname/pytorch-lightning.git
synced 2026-10-26 13:00:58 +08:00
Update lightning_module_template.py
This commit is contained in:
1 parent
9fc66026f1
commit
d5d47eab0d
1 file changed
+1
-1
@@ -194,7 +194,7 @@ class LightningTemplateModel(LightningModule):
|
||||
batch_size = self.hparams.batch_size
|
||||
|
||||
try:
|
||||
if self.on_gpu:
|
||||
if self.trainer.use_ddp:
|
||||
train_sampler = DistributedSampler(dataset, rank=self.trainer.proc_rank)
|
||||
batch_size = batch_size // self.trainer.world_size # scale batch size
|
||||
except Exception:
|
||||
|
||||
Reference in new issue
Block a user