TorchCheckpointIO
- class lightning.pytorch.plugins.io.TorchCheckpointIO
Bases:
CheckpointIOCheckpointIO that utilizes
torch.save()andtorch.load()to save and load checkpoints respectively, common for most use cases.Warning
This is an experimental feature.
- load_checkpoint(path, map_location=<function TorchCheckpointIO.<lambda>>)
Loads checkpoint using
torch.load(), with additional handling forfsspecremote loading of files.- Parameters:
map_location (
Optional[Callable]) – a function,torch.device, string or a dict specifying how to remap storage locations.
- Return type:
Returns: The loaded checkpoint.
- Raises:
FileNotFoundError – If
pathis not found by thefsspecfilesystem
- remove_checkpoint(path)
Remove checkpoint file from the filesystem.
- save_checkpoint(checkpoint, path, storage_options=None)
Save model/training states as a checkpoint file through state-dump and file-write.
Was this page helpful?
Thanks for the feedback.