Repository: Lightning-AI/pytorch-lightning
File: src/lightning/pytorch/trainer/connectors/checkpoint_connector.py (Python)

Code before:
            )
        self.restore_lr_schedulers()

    def restore_optimizers(self) -> None:
        """Restores the optimizer states from the pre-loaded checkpoint."""
        if not self._loaded_checkpoint:
            return

        # restore the optimizers
        self.trainer.strategy.load_optimizer_state_dict(self._loaded_checkpoint)

    def restore_lr_schedulers(self) -> None:
        """Restores the learning rate scheduler states from the pre-loaded checkpoint."""
        if not self._loaded_checkpoint:
            return

        # restore the lr schedulers
        lr_schedulers = self._loaded_checkpoint["lr_schedulers"]
        for config, lrs_state in zip(self.trainer.lr_scheduler_configs, lr_schedulers):
            config.scheduler.load_state_dict(lrs_state)

    def _restore_modules_and_callbacks(
        self, checkpoint_path: Optional[_PATH] = None, weights_only: Optional[bool] = None
    ) -> None:
        # restore modules after setup
        self.resume_start(checkpoint_path, weights_only)
        self.restore_model()
        self.restore_datamodule()
        self.restore_callbacks()

    def dump_checkpoint(self, weights_only: Optional[bool] = None) -> dict:
        """Creating a model checkpoint dictionary object from various component states.

        Args:
            weights_only: If True, only saves model and loops state_dict objects. If False,
            additionally saves callbacks, optimizers, schedulers, and precision plugin states.

        Return:
            structured dictionary: {
                'epoch':                     training epoch
                'global_step':               training global step
                'pytorch-lightning_version': The version of PyTorch Lightning that produced this checkpoint
                'callbacks':                 "callback specific state"[] # if not weights_only
                'optimizer_states':          "PT optim's state_dict"[]   # if not weights_only
                'lr_schedulers':             "PT sched's state_dict"[]   # if not weights_only
                'state_dict':                Model's state_dict (e.g. network weights)
                precision_plugin.__class__.__qualname__:  precision plugin state_dict # if not weights_only
                CHECKPOINT_HYPER_PARAMS_NAME:
                CHECKPOINT_HYPER_PARAMS_KEY:
                CHECKPOINT_HYPER_PARAMS_TYPE:
                something_cool_i_want_to_save: anything you define through model.on_save_checkpoint

Review comment (suggestion):
```suggestion
        self.resume_start(checkpoint_path, weights_only=weights_only)
```

Code after:
            )
        self.restore_lr_schedulers()

    def restore_optimizers(self) -> None:
        """Restores the optimizer states from the pre-loaded checkpoint."""
        if not self._loaded_checkpoint:
            return

        # restore the optimizers
        self.trainer.strategy.load_optimizer_state_dict(self._loaded_checkpoint)

    def restore_lr_schedulers(self) -> None:
        """Restores the learning rate scheduler states from the pre-loaded checkpoint."""
        if not self._loaded_checkpoint:
            return

        # restore the lr schedulers
        lr_schedulers = self._loaded_checkpoint["lr_schedulers"]
        for config, lrs_state in zip(self.trainer.lr_scheduler_configs, lr_schedulers):
            config.scheduler.load_state_dict(lrs_state)

    def _restore_modules_and_callbacks(
        self, checkpoint_path: Optional[_PATH] = None, weights_only: Optional[bool] = None
    ) -> None:
        # restore modules after setup
        self.resume_start(checkpoint_path, weights_only=weights_only)
        self.restore_model()
        self.restore_datamodule()
        self.restore_callbacks()

    def dump_checkpoint(self, weights_only: Optional[bool] = None) -> dict:
        """Creating a model checkpoint dictionary object from various component states.

        Args:
            weights_only: If True, only saves model and loops state_dict objects. If False,
            additionally saves callbacks, optimizers, schedulers, and precision plugin states.

        Return:
            structured dictionary: {
                'epoch':                     training epoch
                'global_step':               training global step
                'pytorch-lightning_version': The version of PyTorch Lightning that produced this checkpoint
                'callbacks':                 "callback specific state"[] # if not weights_only
                'optimizer_states':          "PT optim's state_dict"[]   # if not weights_only
                'lr_schedulers':             "PT sched's state_dict"[]   # if not weights_only
                'state_dict':                Model's state_dict (e.g. network weights)
                precision_plugin.__class__.__qualname__:  precision plugin state_dict # if not weights_only
                CHECKPOINT_HYPER_PARAMS_NAME:
                CHECKPOINT_HYPER_PARAMS_KEY:
                CHECKPOINT_HYPER_PARAMS_TYPE:
                something_cool_i_want_to_save: anything you define through model.on_save_checkpoint