add warning for shuffling in test/val (#1865)

This commit is contained in:
Ashraful Islam
2020-05-18 09:53:02 -04:00
committed by GitHub
parent 7c7e50ca47
commit 981169cacc
+1 -1
View File
@@ -214,7 +214,7 @@ class TrainerDataLoadingMixin(ABC):
# shuffling in val and test set is bad practice
for loader in dataloaders:
if mode in ('val', 'test') and hasattr(loader, 'sampler') and isinstance(loader.sampler, RandomSampler):
raise MisconfigurationException(
rank_zero_warn(
f'Your {mode}_dataloader has shuffle=True, it is best practice to turn'
' this off for validation and test dataloaders.')