mirror of
https://github.com/wassname/pytorch-lightning.git
synced 2026-09-10 12:21:57 +08:00
Update lightning_module_template.py
This commit is contained in:
@@ -194,7 +194,7 @@ class LightningTemplateModel(LightningModule):
|
|||||||
batch_size = self.hparams.batch_size
|
batch_size = self.hparams.batch_size
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if self.on_gpu:
|
if self.trainer.use_ddp:
|
||||||
train_sampler = DistributedSampler(dataset, rank=self.trainer.proc_rank)
|
train_sampler = DistributedSampler(dataset, rank=self.trainer.proc_rank)
|
||||||
batch_size = batch_size // self.trainer.world_size # scale batch size
|
batch_size = batch_size // self.trainer.world_size # scale batch size
|
||||||
except Exception:
|
except Exception:
|
||||||
|
|||||||
Reference in New Issue
Block a user