You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Despite using a separate val dataset, the default sanity val steps affect the indices returned by the train dataloader when shuffling is enabled. The training still executes fine, but this makes it impossible to replicate the exact results of a vanilla PyTorch training (which likely doesn't do a sanity val check) using the same random seed and default trainer settings.
Currently, you can work around this by setting trainer.num_sanity_val_steps=0 but I think it's bad practice to encourage that. Or you might not care about reproducing exact results, however I find that is a crucial step in refactoring from vanilla PyTorch to Lightning. Otherwise, you don't know whether it's your random seeds causing a performance difference or something more serious with the optimizer(s), loss, scheduler(s), data loaders, etc.
🐛 Bug
Despite using a separate val dataset, the default sanity val steps affect the indices returned by the train dataloader when shuffling is enabled. The training still executes fine, but this makes it impossible to replicate the exact results of a vanilla PyTorch training (which likely doesn't do a sanity val check) using the same random seed and default trainer settings.
Currently, you can work around this by setting
trainer.num_sanity_val_steps=0
but I think it's bad practice to encourage that. Or you might not care about reproducing exact results, however I find that is a crucial step in refactoring from vanilla PyTorch to Lightning. Otherwise, you don't know whether it's your random seeds causing a performance difference or something more serious with the optimizer(s), loss, scheduler(s), data loaders, etc.To Reproduce
Run this Colab notebook with the
BoringModel
Expected behavior
The shuffling of train batches should not be affected by whether we've run sanity steps with the val data loader
Environment
Automated output provided by Colab notebook
Additional context
This is my first time working with Colab, so let me know if there are any permissions or other issues that need to be resolved
The text was updated successfully, but these errors were encountered: