Utils
Lightning utils.
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:
-
Configuration–A CAREamics configuration object.
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.