mirror of
https://github.com/wassname/pytorch-lightning.git
synced 2026-10-29 13:30:57 +08:00
Fixing logic (#1734)
This commit is contained in:
1 parent
2a2f303ae9
commit
d6a0375974
1 file changed
+1
-1
@@ -325,7 +325,7 @@ class TrainerTrainLoopMixin(ABC):
|
||||
if self.reload_dataloaders_every_epoch:
|
||||
self.reset_train_dataloader(model)
|
||||
# set seed for distributed sampler (enables shuffling for each epoch)
|
||||
if self.use_ddp or self.use_horovod \
|
||||
if (self.use_ddp or self.use_horovod) \
|
||||
and hasattr(self.train_dataloader.sampler, 'set_epoch'):
|
||||
self.train_dataloader.sampler.set_epoch(epoch)
|
||||
|
||||
|
||||
Reference in new issue
Block a user