Lightning-AI/pytorch-lightning

Support all iterator modes for fit/validate/test/predict

Open

#16.830 aberto em 21 de fev. de 2023

Ver no GitHub
 (15 comments) (6 reactions) (0 assignees)Python (3.233 forks)batch import
data handlingfeaturehelp wantedpl

Métricas do repositório

Stars
 (26.687 stars)
Métricas de merge de PR
 (Mesclagem média 9d 15h) (3 fundiu PRs em 30d)

Description

Description & Motivation

trainer.fit only works with CombinedLoader(..., mode="max_size_cycle"|"min_size")

trainer.{validate,test,predict} only works with CombinedLoader(..., mode="sequential")

This constraint is checked in the top-level loops: https://github.com/Lightning-AI/lightning/blob/0009cde1db1a9ab4e2f1e0a9f69a4affb59d5134/src/lightning/pytorch/loops/fit_loop.py#L351-L354 https://github.com/Lightning-AI/lightning/blob/0009cde1db1a9ab4e2f1e0a9f69a4affb59d5134/src/lightning/pytorch/loops/evaluation_loop.py#L182-L183

Pitch

Have all trainer functions support all modes

TODO:

  • FitLoop
  • EvaluationLoop (#17163)
  • PredictionLoop

Alternatives

Not do it

Additional context

This builds on top of https://github.com/Lightning-AI/lightning/pull/16726

cc @borda @justusschock @awaelchli

Guia do colaborador