CHECKPOINTS#

Functions#

utils.checkpoints.mammoth_load_checkpoint(args, model, ignore_classifier=False)[source]#

Loads the keys from the given checkpoint. - Handles DataParallel and DistributedDataParallel checkpoints. - Handles checkpoints from previous versions of the code. - Handles head initialization for LUCIR.

Parameters:
  • args – the model with the checkpoint loaded.

  • model (Module) – the model to be loaded.

  • ignore_classifier – whether to ignore the classifier weights.

Returns:

the model with the checkpoint loaded.

Return type:

Module

utils.checkpoints.save_mammoth_checkpoint(task, end_task, args, model, results=None, optimizer_st=None, scheduler_st=None)[source]#

Save a checkpoint for the model for the given task. Handles saving as a single file (will require weights_only=False) or separate weights (can be loaded safely with weights_only=True).

utils.checkpoints.to_parsable_obj(r)[source]#

Convert a non-builtin object to a parsable (and loadable with weights_only=True) object. Looking at you, Namespace.

Return type:

Dict | list | str | int | float | bool