fix: improve UserWarning message (#7685)

* fix: improve UserWarning message
when both overfit and training dtaloader shuffling are enabled

fixes issue: #7656

* chore: update changelog

* Polish userwarning msg in pytorch_lightning/trainer/data_loading.py

Co-authored-by: ananthsub <ananth.subramaniam@gmail.com>

* shuffling typo

* Update CHANGELOG.md

Co-authored-by: ananthsub <ananth.subramaniam@gmail.com>
Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>
Co-authored-by: Carlos Mocholí <carlossmocholi@gmail.com>
This commit is contained in:
Xinyao(Alvin) Sun 2021-05-25 11:35:15 -06:00 committed by GitHub
parent e7057d5898
commit 7e2f7e956b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -124,6 +124,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
### Fixed
- Fixed ambiguous warning when both overfit and train dataloader shuffling are enabled ([#7685](https://github.com/PyTorchLightning/pytorch-lightning/pull/7685))
- Fixed dataloaders are not reset when tuning the model ([#7566](https://github.com/PyTorchLightning/pytorch-lightning/pull/7566))

View File

@ -238,7 +238,7 @@ class TrainerDataLoadingMixin(ABC):
if hasattr(self.train_dataloader, 'sampler') and isinstance(self.train_dataloader.sampler, RandomSampler):
rank_zero_warn(
'You requested to overfit but enabled training dataloader shuffling.'
' We are turning it off for you.'
' We are turning off the training dataloader shuffling for you.'
)
self.train_dataloader = self.replace_sampler(
self.train_dataloader, SequentialSampler(self.train_dataloader.dataset)