mirror of
https://github.com/wassname/pytorch-lightning.git
synced 2026-09-11 12:31:23 +08:00
Sai prasanna master (#219)
* Fix incorrect warning for DistributedSampler. Check whether `dataloader.sampler` is an instance of DistributedSampler instead of checking the `dataloader`. * Update trainer.py * merged
This commit is contained in:
@@ -585,9 +585,9 @@ class Trainer(TrainerIO):
|
||||
|
||||
if self.use_ddp and self.val_dataloader is not None:
|
||||
for dataloader in self.val_dataloader:
|
||||
if not isinstance(dataloader, DistributedSampler):
|
||||
if not isinstance(dataloader.sampler, DistributedSampler):
|
||||
msg = """
|
||||
Your val_dataloader(s) are not all DistributedSamplers.
|
||||
Your val_dataloader(s) don't use DistributedSampler.
|
||||
You're using multiple gpus and multiple nodes without using a DistributedSampler
|
||||
to assign a subset of your data to each process. To silence this warning, pass a
|
||||
DistributedSampler to your DataLoader.
|
||||
@@ -608,9 +608,9 @@ class Trainer(TrainerIO):
|
||||
|
||||
if self.use_ddp and self.test_dataloader is not None:
|
||||
for dataloader in self.test_dataloader:
|
||||
if not isinstance(dataloader, DistributedSampler):
|
||||
if not isinstance(dataloader.sampler, DistributedSampler):
|
||||
msg = """
|
||||
Your test_dataloader(s) are not all DistributedSamplers.
|
||||
Your test_dataloader(s) don't use DistributedSampler.
|
||||
You're using multiple gpus and multiple nodes without using a DistributedSampler
|
||||
to assign a subset of your data to each process. To silence this warning, pass a
|
||||
DistributedSampler to your DataLoader.
|
||||
|
||||
Reference in New Issue
Block a user