Dataloader is reloaded twice after resuming from checkpoint #9502
Labels
bug
Something isn't working
checkpointing
Related to checkpointing
data handling
Generic data-related topic
help wanted
Open to be worked on
let's do it!
approved to implement
🚀 Feature
Motivation
PyTorch Lightning reloads dataloader twice after resuming from checkpoint:
the first time reloads before train loop start [link];
The second reloads of default value for
reload_dataloaders_every_n_epochs
[link]This behavior could be problematic:
reload_dataloaders_every_n_epochs = 1
forces the dataloaders to reload once every n epochs, but it loads multiple times sometimes.Pitch
Let's remove
self.reset_train_val_dataloaders(model)
in_run_train()
[link]Because reset_*_dataloader() will be called in fit loop, there's no need to call it in trainer.
Alternatives
N/A
Additional context
cc: @awaelchli @ananthsub
If you enjoy Lightning, check out our other projects! ⚡
Metrics: Machine learning metrics for distributed, scalable PyTorch applications.
Flash: The fastest way to get a Lightning baseline! A collection of tasks for fast prototyping, baselining, finetuning and solving problems with deep learning
Bolts: Pretrained SOTA Deep Learning models, callbacks and more for research and production with PyTorch Lightning and PyTorch
Lightning Transformers: Flexible interface for high performance research using SOTA Transformers leveraging Pytorch Lightning, Transformers, and Hydra.
The text was updated successfully, but these errors were encountered: