Skip to content

Load Checkpoint

Source

Module for loading CAREamics models and configs from a checkpoint.

load_config_from_checkpoint(checkpoint_path)

Load a CAREamics config from a checkpoint.

Some fields, if missing, will be populated by defaults. Namely, version, training_config and experiment_name.

The default for experiment_name will be "loaded_from_<checkpoint_filename>".

Parameters:

  • checkpoint_path (Path) –

    Path to the PyTorch Lightning checkpoint file.

Returns:

Raises:

  • ValueErrors:

    If certain required information is not found in the checkpoint.

load_module_from_checkpoint(checkpoint_path)

Load a trained CAREamics module from checkpoint.

Automatically detects the algorithm type from the checkpoint and loads the appropriate module with trained weights.

Parameters:

  • checkpoint_path (Path) –

    Path to the PyTorch Lightning checkpoint file.

Returns:

  • CAREamicsModule

    Lightning module with loaded weights.

Raises:

  • ValueError

    If the algorithm type cannot be determined from the checkpoint.