get_callbacks
- lightning_pose.callbacks.get_callbacks(cfg: DictConfig | ListConfig, early_stopping: bool = False, checkpointing: bool = True, lr_monitor: bool = True, ckpt_every_n_epochs: int | None = None, backbone_unfreeze: bool = True, status_file: Path | None = None) list[source]
Build and return the list of training callbacks based on the config.
- Parameters:
cfg – hydra config containing training and callback parameters.
early_stopping – if True, add an
EarlyStoppingcallback.checkpointing – if True, add a
ModelCheckpointcallback that saves the best model.lr_monitor – if True, add a
LearningRateMonitorcallback.ckpt_every_n_epochs – if not None, also save a checkpoint every this many epochs.
backbone_unfreeze – if True, add the
UnfreezeBackbonecallback.status_file – if not None, add a
JSONTrainingProgressTrackercallback writing to this path.
- Returns:
List of callback objects ready to pass to a
pl.Trainer.