Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/probot-check-group.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ jobs:
required-jobs:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
timeout-minutes: 61 # in case something is wrong with the internal timeout
timeout-minutes: 71 # in case something is wrong with the internal timeout
steps:
- uses: Lightning-AI/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
job: check-group
interval: 180 # seconds
timeout: 60 # minutes
timeout: 70 # minutes
maintainers: "Lightning-AI/lai-frameworks"
owner: "carmocca"
2 changes: 1 addition & 1 deletion .lightning/workflows/fabric.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ trigger:
pull_request:
branches: ["master", "release/stable"]

timeout: "55" # minutes
timeout: "60" # minutes
parametrize:
matrix: {}
include:
Expand Down
2 changes: 1 addition & 1 deletion .lightning/workflows/pytorch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ trigger:
pull_request:
branches: ["master", "release/stable"]

timeout: "55" # minutes
timeout: "60" # minutes
parametrize:
matrix: {}
include:
Expand Down
8 changes: 7 additions & 1 deletion docs/source-pytorch/common/checkpointing_intermediate.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@ For fine-grained control over checkpointing behavior, use the :class:`~lightning
checkpoint_callback = ModelCheckpoint(dirpath="my/path/", save_top_k=2, monitor="val_loss")
trainer = Trainer(callbacks=[checkpoint_callback])
trainer.fit(model)
checkpoint_callback.best_model_path
# Access best and last model checkpoint directly from the callback
print(checkpoint_callback.best_model_path)
print(checkpoint_callback.last_model_path)
# Or via the trainer
print(trainer.checkpoint_callback.best_model_path)
print(trainer.checkpoint_callback.last_model_path)
Any value that has been logged via *self.log* in the LightningModule can be monitored.

Expand Down
10 changes: 5 additions & 5 deletions src/lightning/pytorch/callbacks/model_checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,11 @@ class ModelCheckpoint(Checkpoint):
... )
# retrieve the best checkpoint after training
checkpoint_callback = ModelCheckpoint(dirpath='my/path/')
trainer = Trainer(callbacks=[checkpoint_callback])
model = ...
trainer.fit(model)
checkpoint_callback.best_model_path
>>> checkpoint_callback = ModelCheckpoint(dirpath='my/path/')
>>> trainer = Trainer(callbacks=[checkpoint_callback])
>>> model = ... # doctest: +SKIP
>>> trainer.fit(model) # doctest: +SKIP
>>> print(checkpoint_callback.best_model_path) # doctest: +SKIP
.. tip:: Saving and restoring multiple checkpoint callbacks at the same time is supported under variation in the
following arguments:
Expand Down
Loading