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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

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.')