We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3df6a80 + 9851645 commit 4a8ecb2Copy full SHA for 4a8ecb2
src/nn_core/callbacks.py
@@ -53,4 +53,6 @@ def on_save_checkpoint(
53
) -> None:
54
if self._is_nnlogger(trainer):
55
trainer.logger.on_save_checkpoint(trainer=trainer, pl_module=pl_module, checkpoint=checkpoint)
56
- checkpoint[METADATA_KEY] = trainer.datamodule.metadata
+ metadata = getattr(trainer.datamodule, "metadata", None)
57
+ if metadata is not None:
58
+ checkpoint[METADATA_KEY] = metadata
0 commit comments