TorchCheckpointIO
- class pytorch_lightning.plugins.io.TorchCheckpointIO[source]
Bases:
pytorch_lightning.plugins.io.checkpoint_plugin.CheckpointIO
CheckpointIO that utilizes
torch.save()
andtorch.load()
to save and load checkpoints respectively, common for most use cases.- load_checkpoint(path, map_location=<function TorchCheckpointIO.<lambda>>)[source]
Loads checkpoint using
torch.load()
, with additional handling forfsspec
remote loading of files.- Parameters
Returns: The loaded checkpoint.
- Raises
FileNotFoundError – If
path
is not found by thefsspec
filesystem- Return type
- remove_checkpoint(path)[source]
Remove checkpoint file from the filesystem.
- save_checkpoint(checkpoint, path, storage_options=None)[source]
Save model/training states as a checkpoint file through state-dump and file-write.