Skip to content

Commit 7d8dd91

Browse files
committed
Update checkpointing documentation to mark resume_from_checkpoint as deprecated
1 parent c09fc66 commit 7d8dd91

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

docs/source-pytorch/common/checkpointing_basic.rst

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ PyTorch Lightning checkpoints are fully usable in plain PyTorch.
2020

2121
----
2222

23+
.. important::
24+
25+
**Important Update: Deprecated Method**
26+
27+
Starting from PyTorch Lightning v1.0.0, the `resume_from_checkpoint` parameter has been deprecated. To resume training from a checkpoint, use the `ckpt_path` parameter in the `fit()` method.
28+
Please update your code accordingly to avoid potential compatibility issues.
29+
2330
************************
2431
Contents of a checkpoint
2532
************************
@@ -197,16 +204,31 @@ You can disable checkpointing by passing:
197204

198205
----
199206

207+
200208
*********************
201209
Resume training state
202210
*********************
203211

204212
If you don't just want to load weights, but instead restore the full training, do the following:
205213

214+
.. warning::
215+
216+
The parameter `resume_from_checkpoint` has been deprecated in recent versions of PyTorch Lightning.
217+
Please use the `ckpt_path` argument in the `fit()` method instead.
218+
219+
Incorrect (deprecated) usage:
220+
221+
.. code-block:: python
222+
223+
trainer = Trainer(resume_from_checkpoint="path/to/your/checkpoint.ckpt")
224+
trainer.fit(model)
225+
226+
Correct usage:
227+
206228
.. code-block:: python
207229
208230
model = LitModel()
209231
trainer = Trainer()
210232
211233
# automatically restores model, epoch, step, LR schedulers, etc...
212-
trainer.fit(model, ckpt_path="some/path/to/my_checkpoint.ckpt")
234+
trainer.fit(model, ckpt_path="path/to/your/checkpoint.ckpt")

0 commit comments

Comments
 (0)