Resuming training from checkpoint results in "No train_dataloader() method defined" error - Possible documentation issue?
📚 Documentation
I'm trying to resume training a model from a checkpoint, which, as far as I understand from the docs, should have all the information necessary for the Trainer to resume training (see Restoring Training State).
However, when calling trainer.fit with exactly those two arguments, I receive the following error
Exception has occurred: MisconfigurationException (note: full exception trace is shown but execution is paused at: _run_module_as_main)
No `train_dataloader()` method defined. Lightning `Trainer` expects as minimum a `training_step()`, `train_dataloader()` and `configure_optimizers()` to be defined.
Isn't this supposed to restore the data module as well, at least according to this section of the docs? Am I doing something wrong?
cc @borda
Sorry never seeing this issue before. If you've trained with a datamodule, and want to restore training later on, you still need to pass the datamodule as input to trainer.fit(). By restoring the datamodule, what is meant is that its state is restored, not its definition, so you can't omit passing it in.