mednet.utils.checkpointer

Module Attributes

CHECKPOINT_ALIASES

Standard paths where checkpoints may be (if produced with this framework).

Functions

get_checkpoint_to_resume_training(path)

Return the best checkpoint file path to resume training from.

get_checkpoint_to_run_inference(path)

Return the best checkpoint file path to run inference with.

mednet.utils.checkpointer.CHECKPOINT_ALIASES = {'best': 'model-at-lowest-validation-loss-{epoch}', 'periodic': 'model-at-{epoch}'}

Standard paths where checkpoints may be (if produced with this framework).

mednet.utils.checkpointer.get_checkpoint_to_resume_training(path)[source]

Return the best checkpoint file path to resume training from.

Parameters:

path (Path) – The base directory containing either the “periodic” checkpoint to start the training session from.

Returns:

Path to a checkpoint file that exists on disk.

Return type:

pathlib.Path

Raises:

FileNotFoundError – If none of the checkpoints can be found on the provided directory.

mednet.utils.checkpointer.get_checkpoint_to_run_inference(path)[source]

Return the best checkpoint file path to run inference with.

Parameters:

path (Path) – The base directory containing either the “best”, “last” or “periodic” checkpoint to start the training session from.

Returns:

Path to a checkpoint file that exists on disk.

Return type:

pathlib.Path

Raises:

FileNotFoundError – If none of the checkpoints can be found on the provided directory.