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(".")])