OnExceptionCheckpoint
- class lightning.pytorch.callbacks.OnExceptionCheckpoint(dirpath, filename='on_exception')[source]
Bases:
Checkpoint
Used to save a checkpoint on exception.
- Parameters:
- Raises:
ValueError – If
filename
is empty.
Example
>>> from lightning.pytorch import Trainer >>> from lightning.pytorch.callbacks import OnExceptionCheckpoint >>> trainer = Trainer(callbacks=[OnExceptionCheckpoint(".")])
- on_exception(trainer, *_, **__)[source]
Called when any trainer execution is interrupted by an exception.
- Return type: