Hi!
A noob question and maybe I am missing something. Why does it call fit() again when a model is loaded from checkpoint?
Thanks!
Hi! thanks for your contribution!, great first issue!
Fit function handles both training and testing. self.testing is set to True in .test().
https://github.com/PyTorchLightning/pytorch-lightning/blob/f972ab3a828eae1847a793da0b2c25c6074647a4/pytorch_lightning/trainer/trainer.py#L1169
and if self.testing == True, it will test only.
https://github.com/PyTorchLightning/pytorch-lightning/blob/f972ab3a828eae1847a793da0b2c25c6074647a4/pytorch_lightning/trainer/trainer.py#L1052-L1056
Training is done with self.train()
https://github.com/PyTorchLightning/pytorch-lightning/blob/f972ab3a828eae1847a793da0b2c25c6074647a4/pytorch_lightning/trainer/trainer.py#L1092-L1093
I still think .fit() should be renamed to something else that can be easy to interpret if someone is new to lightning.
@rohitgr7 A PR for this was proposed here: #2107. Eventually it will be done out of necessity ;)
I am getting an error from MlFlowLogger, because self.logger.log_hyperparams(ref_model.hparams) stays before self.run_evaluation(test_mode=True). Consequently, mlflow throws an error due to logging hyperparams twice
Most helpful comment
Fit function handles both training and testing.
self.testingis set toTruein.test().https://github.com/PyTorchLightning/pytorch-lightning/blob/f972ab3a828eae1847a793da0b2c25c6074647a4/pytorch_lightning/trainer/trainer.py#L1169
and if
self.testing == True, it will test only.https://github.com/PyTorchLightning/pytorch-lightning/blob/f972ab3a828eae1847a793da0b2c25c6074647a4/pytorch_lightning/trainer/trainer.py#L1052-L1056
Training is done with
self.train()https://github.com/PyTorchLightning/pytorch-lightning/blob/f972ab3a828eae1847a793da0b2c25c6074647a4/pytorch_lightning/trainer/trainer.py#L1092-L1093
I still think
.fit()should be renamed to something else that can be easy to interpret if someone is new to lightning.