From 3a642601e84c3abf1f1b438f9acc932a1f150f7f Mon Sep 17 00:00:00 2001 From: Yuri Brovman Date: Thu, 7 May 2020 09:26:41 -0400 Subject: [PATCH] added warning for None dataloader (#1745) * added warning for None dataloader * fixed variable style * updated warning message * remove unused import Co-authored-by: ybrovman --- pytorch_lightning/trainer/data_loading.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pytorch_lightning/trainer/data_loading.py b/pytorch_lightning/trainer/data_loading.py index 0428f4951e..3557e2c83a 100644 --- a/pytorch_lightning/trainer/data_loading.py +++ b/pytorch_lightning/trainer/data_loading.py @@ -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]