added warning for None dataloader (#1745)
* added warning for None dataloader * fixed variable style * updated warning message * remove unused import Co-authored-by: ybrovman <ybrovman@ebay.com>
This commit is contained in:
parent
f656882942
commit
3a642601e8
|
@ -218,6 +218,9 @@ class TrainerDataLoadingMixin(ABC):
|
|||
f'Your {mode}_dataloader has shuffle=True, it is best practice to turn'
|
||||
' this off for validation and test dataloaders.')
|
||||
|
||||
if any([dl is None for dl in dataloaders]):
|
||||
rank_zero_warn("One of given dataloaders is None and it will be skipped.")
|
||||
|
||||
# add samplers
|
||||
dataloaders = [self.auto_add_sampler(dl, train=False) for dl in dataloaders if dl is not None]
|
||||
|
||||
|
|
Loading…
Reference in New Issue