Skip to content

Even when val DataLoader has shuffle=False, Lightning gives an incorrect warning that val Dataloader has shuffle=True #11856

@vineetk1

Description

@vineetk1

🐛 Bug

Even when DataLoader(self.valid_data, shuffle=False, ...), Lightning gives the following message: UserWarning: Your val_dataloader has shuffle=True,.......

To Reproduce

Assign shuffle=False in both the val and test dataloaders. Run the code and see the following two warning messages:

.../.local/lib/python3.8/site-packages/pytorch_lightning/trainer/data_loading.py:659: UserWarning: Your val_dataloader has shuffle=True, it is strongly recommended that you turn this off for val/test/predict dataloaders.

.local/lib/python3.8/site-packages/pytorch_lightning/trainer/data_loading.py:659: UserWarning: Your test_dataloader has shuffle=True, it is strongly recommended that you turn this off for val/test/predict dataloaders.

Expected behavior

There should be no warning messages.

Environment

  • PyTorch Lightning Version (e.g., 1.5.0): 1.5.9
  • PyTorch Version (e.g., 1.10): 1.10.2
  • Python version (e.g., 3.9): 3.8.10
  • OS (e.g., Linux): Linux (Ubuntu)
  • CUDA/cuDNN version: cu113
  • GPU models and configuration: GTX 1080
  • How you installed PyTorch (conda, pip, source): pip

Additional context

Previous versions of Lightning also gave those warning messages

cc @justusschock @awaelchli @ninginthecloud @tchaton @rohitgr7 @akihironitta

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdata handlingGeneric data-related topicpriority: 2Low priority task

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions