Shortcuts

DiskSaver#

class ignite.handlers.DiskSaver(dirname, atomic=True, create_dir=True, require_empty=True, save_on_rank=0, **kwargs)[source]#

Handler that saves input checkpoint on a disk.

Parameters
  • dirname (Union[str, Path]) – Directory path where the checkpoint will be saved

  • atomic (bool) – if True, checkpoint is serialized to a temporary file, and then moved to final destination, so that files are guaranteed to not be damaged (for example if exception occurs during saving).

  • create_dir (bool) – if True, will create directory dirname if it doesnt exist.

  • require_empty (bool) – If True, will raise exception if there are any files in the directory dirname.

  • save_on_rank (int) – The rank on which the checkpoint will be saved. Used in distributed configuration.

  • kwargs (Any) – Accepted keyword arguments for torch.save or xm.save.

Changed in version 0.4.2: Accept kwargs for torch.save or xm.save.

Changed in version 0.4.10: Argument save_on_rank was added to specify the rank on which checkpoint should be saved.

Methods

remove

Method to remove saved checkpoint.

remove(filename)[source]#

Method to remove saved checkpoint.

Parameters

filename (str) – filename associated with checkpoint.

Return type

None