add warning for shuffling in test/val (#1865)
This commit is contained in:
parent
7c7e50ca47
commit
981169cacc
|
@ -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.')
|
||||
|
||||
|
|
Loading…
Reference in New Issue