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
This would be great to have! I just got bitten by this when trying to call model.predict(datamodule=...) because .setup(stage='predict') isn't called there's nothing for my datamodule return. (Here's the notebook I created based on "The BoringModule" in case that is useful: https://colab.research.google.com/drive/1-D7EcIDMeONje2aIr6nEfDnqhibj12OB?usp=sharing). I use a datamodule because that allows me to encapsulate the transforms applied to my data and use them both during training, test and prediction.
🚀 Feature
Currently.
DataModule.setup
is only called with stagesfit
ortest
. But we have several more:Stages:
https://github.com/PyTorchLightning/pytorch-lightning/blob/5f3372871a333c3229968f1af1b10a925d7ec3ec/pytorch_lightning/trainer/states.py#L39-L49
Note that it's a bit tricky because
fit
is not aRunningStage
. It indicatestrain
oreval
Motivation
Allows having custom logic for each stage
Pitch
Additional context
We are passing 'test' when predicting as seen in #5579
https://github.com/PyTorchLightning/pytorch-lightning/blob/9137b16068fe03e6db8df548235363e5f5476aac/pytorch_lightning/trainer/trainer.py#L909
The text was updated successfully, but these errors were encountered: