Description
🚀 Feature
Motivation
has_len()
in data.py checks if dataloader has __len__
method implemented.
When dataloader has zero length, it raises a ValueError (see code). Recently, we got task from users brought up that when dataset has fewer samples than number of ranks, sampler would split the dataset unevenly, and sometimes 0 batch on certain ranks is inevitable. This ValueError blocked them to have successful PL run. This is also bridging the gap for Detectron2Go to better use Lightning: https://github.com/facebookresearch/d2go
Pitch
Replace ValueError with warning
Sync the length of dataloader across ranks instead of checking local dataset. By doing so, we can catch the situation when user unintentionally fit empty dataloader
Alternatives
Additional context
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.