Sampler (#1328)
* sampler * check for dataloader type * check for dataloader type * fixed sampler cases
This commit is contained in:
parent
7de51f78ac
commit
e48422df38
|
@ -79,11 +79,11 @@ class TrainerDataLoadingMixin(ABC):
|
|||
if not isinstance(dataloader, DataLoader):
|
||||
return dataloader
|
||||
|
||||
# don't add sampler when user gives one
|
||||
if dataloader.sampler is not None:
|
||||
return dataloader
|
||||
need_dist_sampler = self.use_ddp or self.use_ddp2 or self.use_tpu
|
||||
no_sampler_added = dataloader.sampler is None
|
||||
|
||||
if need_dist_sampler and no_sampler_added:
|
||||
|
||||
if self.use_ddp or self.use_ddp2 or self.use_tpu:
|
||||
dl_args = {
|
||||
'dataset': dataloader.dataset,
|
||||
'batch_size': dataloader.batch_size,
|
||||
|
|
Loading…
Reference in New Issue