Shortcuts

OnExceptionCheckpoint

class lightning.pytorch.callbacks.OnExceptionCheckpoint(dirpath, filename='on_exception')[소스]

기반 클래스: lightning.pytorch.callbacks.checkpoint.Checkpoint

Used to save a checkpoint on exception.

매개변수
  • dirpath (Union[str, Path]) – directory to save the checkpoint file.

  • filename (str) – checkpoint filename. This must not include the extension.

예외 발생

ValueError – If filename is empty.

예제

>>> from lightning.pytorch import Trainer
>>> from lightning.pytorch.callbacks import OnExceptionCheckpoint
>>> trainer = Trainer(callbacks=[OnExceptionCheckpoint(".")])
on_exception(trainer, *_, **__)[소스]

Called when any trainer execution is interrupted by an exception.

반환 형식

None

teardown(trainer, *_, **__)[소스]

Called when fit, validate, test, predict, or tune ends.

반환 형식

None