Skip to content

Commit 1f80567

Browse files
Alan ChuAlan Chu
authored andcommitted
Allow callbacks to be restored not just during training
1 parent 3627c5b commit 1f80567

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/lightning/pytorch/trainer/connectors/checkpoint_connector.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -397,9 +397,7 @@ def _restore_modules_and_callbacks(self, checkpoint_path: Optional[_PATH] = None
397397
self.resume_start(checkpoint_path)
398398
self.restore_model()
399399
self.restore_datamodule()
400-
if self.trainer.state.fn == TrainerFn.FITTING:
401-
# restore callback states
402-
self.restore_callbacks()
400+
self.restore_callbacks()
403401

404402
def dump_checkpoint(self, weights_only: bool = False) -> dict:
405403
"""Creating a model checkpoint dictionary object from various component states.

0 commit comments

Comments
 (0)