From 7d8dd91f34b0e6f71f3161e1f0b8f5a014fb412b Mon Sep 17 00:00:00 2001 From: wangYue0000 <3271940653@qq.com> Date: Mon, 9 Dec 2024 12:56:39 +0800 Subject: [PATCH 1/7] Update checkpointing documentation to mark resume_from_checkpoint as deprecated --- .../common/checkpointing_basic.rst | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/docs/source-pytorch/common/checkpointing_basic.rst b/docs/source-pytorch/common/checkpointing_basic.rst index 5c74178f0eaaa..c1a24f0819c71 100644 --- a/docs/source-pytorch/common/checkpointing_basic.rst +++ b/docs/source-pytorch/common/checkpointing_basic.rst @@ -20,6 +20,13 @@ PyTorch Lightning checkpoints are fully usable in plain PyTorch. ---- +.. important:: + + **Important Update: Deprecated Method** + + 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. + Please update your code accordingly to avoid potential compatibility issues. + ************************ Contents of a checkpoint ************************ @@ -197,16 +204,31 @@ You can disable checkpointing by passing: ---- + ********************* Resume training state ********************* If you don't just want to load weights, but instead restore the full training, do the following: +.. warning:: + + The parameter `resume_from_checkpoint` has been deprecated in recent versions of PyTorch Lightning. + Please use the `ckpt_path` argument in the `fit()` method instead. + +Incorrect (deprecated) usage: + +.. code-block:: python + + trainer = Trainer(resume_from_checkpoint="path/to/your/checkpoint.ckpt") + trainer.fit(model) + +Correct usage: + .. code-block:: python model = LitModel() trainer = Trainer() # automatically restores model, epoch, step, LR schedulers, etc... - trainer.fit(model, ckpt_path="some/path/to/my_checkpoint.ckpt") + trainer.fit(model, ckpt_path="path/to/your/checkpoint.ckpt") From 4095113e20e10d0d91f3a353624786da5521076d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 9 Dec 2024 05:15:52 +0000 Subject: [PATCH 2/7] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- docs/source-pytorch/common/checkpointing_basic.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source-pytorch/common/checkpointing_basic.rst b/docs/source-pytorch/common/checkpointing_basic.rst index c1a24f0819c71..0ee80008bf036 100644 --- a/docs/source-pytorch/common/checkpointing_basic.rst +++ b/docs/source-pytorch/common/checkpointing_basic.rst @@ -213,7 +213,7 @@ If you don't just want to load weights, but instead restore the full training, d .. warning:: - The parameter `resume_from_checkpoint` has been deprecated in recent versions of PyTorch Lightning. + The parameter `resume_from_checkpoint` has been deprecated in recent versions of PyTorch Lightning. Please use the `ckpt_path` argument in the `fit()` method instead. Incorrect (deprecated) usage: From 4ed03f55e7a0455f2d2ae423f67346fcab0e8167 Mon Sep 17 00:00:00 2001 From: WangYue0000 <142971062+WangYue0000@users.noreply.github.com> Date: Tue, 10 Dec 2024 19:15:44 +0800 Subject: [PATCH 3/7] Update docs/source-pytorch/common/checkpointing_basic.rst Co-authored-by: Luca Antiga --- docs/source-pytorch/common/checkpointing_basic.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source-pytorch/common/checkpointing_basic.rst b/docs/source-pytorch/common/checkpointing_basic.rst index 0ee80008bf036..79e37aa4c5bbc 100644 --- a/docs/source-pytorch/common/checkpointing_basic.rst +++ b/docs/source-pytorch/common/checkpointing_basic.rst @@ -24,7 +24,7 @@ PyTorch Lightning checkpoints are fully usable in plain PyTorch. **Important Update: Deprecated Method** - 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. + Starting from PyTorch Lightning v1.0.0, the `resume_from_checkpoint` argument has been deprecated. To resume training from a checkpoint, use the `ckpt_path` argument in the `fit()` method. Please update your code accordingly to avoid potential compatibility issues. ************************ From 1874ef37494047c605bafb2d7a1e1141d4f88329 Mon Sep 17 00:00:00 2001 From: WangYue0000 <142971062+WangYue0000@users.noreply.github.com> Date: Tue, 10 Dec 2024 19:16:11 +0800 Subject: [PATCH 4/7] Update docs/source-pytorch/common/checkpointing_basic.rst Co-authored-by: Luca Antiga --- docs/source-pytorch/common/checkpointing_basic.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source-pytorch/common/checkpointing_basic.rst b/docs/source-pytorch/common/checkpointing_basic.rst index 79e37aa4c5bbc..a076315b48b7f 100644 --- a/docs/source-pytorch/common/checkpointing_basic.rst +++ b/docs/source-pytorch/common/checkpointing_basic.rst @@ -213,7 +213,7 @@ If you don't just want to load weights, but instead restore the full training, d .. warning:: - The parameter `resume_from_checkpoint` has been deprecated in recent versions of PyTorch Lightning. + The argument `resume_from_checkpoint` has been deprecated in versions of PyTorch Lightning >= 1.0.0. Please use the `ckpt_path` argument in the `fit()` method instead. Incorrect (deprecated) usage: From 1c08b0aeb71031e949efef4b49377d6f7cd54302 Mon Sep 17 00:00:00 2001 From: wangYue0000 <3271940653@qq.com> Date: Tue, 10 Dec 2024 19:28:52 +0800 Subject: [PATCH 5/7] Address review comments --- docs/source-pytorch/common/checkpointing_basic.rst | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/source-pytorch/common/checkpointing_basic.rst b/docs/source-pytorch/common/checkpointing_basic.rst index a076315b48b7f..4d7c412948c8a 100644 --- a/docs/source-pytorch/common/checkpointing_basic.rst +++ b/docs/source-pytorch/common/checkpointing_basic.rst @@ -213,7 +213,7 @@ If you don't just want to load weights, but instead restore the full training, d .. warning:: - The argument `resume_from_checkpoint` has been deprecated in versions of PyTorch Lightning >= 1.0.0. + The parameter `resume_from_checkpoint` has been deprecated in recent versions of PyTorch Lightning. Please use the `ckpt_path` argument in the `fit()` method instead. Incorrect (deprecated) usage: @@ -232,3 +232,15 @@ Correct usage: # automatically restores model, epoch, step, LR schedulers, etc... trainer.fit(model, ckpt_path="path/to/your/checkpoint.ckpt") + +.. warning:: + + The argument `resume_from_checkpoint` has been deprecated in versions of PyTorch Lightning >= 1.0.0. + To resume training from a checkpoint, use the `ckpt_path` argument in the `fit()` method instead. + +Incorrect (deprecated) usage: + +.. code-block:: python + + trainer = Trainer(resume_from_checkpoint="path/to/your/checkpoint.ckpt") + trainer.fit(model) From 242afd1280b0f230821c6b24c4b62e1e4632e968 Mon Sep 17 00:00:00 2001 From: wangYue0000 <3271940653@qq.com> Date: Tue, 10 Dec 2024 19:32:01 +0800 Subject: [PATCH 6/7] Address review comments --- docs/source-pytorch/common/checkpointing_basic.rst | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/docs/source-pytorch/common/checkpointing_basic.rst b/docs/source-pytorch/common/checkpointing_basic.rst index 4d7c412948c8a..c0c1c6b846d81 100644 --- a/docs/source-pytorch/common/checkpointing_basic.rst +++ b/docs/source-pytorch/common/checkpointing_basic.rst @@ -211,18 +211,6 @@ Resume training state If you don't just want to load weights, but instead restore the full training, do the following: -.. warning:: - - The parameter `resume_from_checkpoint` has been deprecated in recent versions of PyTorch Lightning. - Please use the `ckpt_path` argument in the `fit()` method instead. - -Incorrect (deprecated) usage: - -.. code-block:: python - - trainer = Trainer(resume_from_checkpoint="path/to/your/checkpoint.ckpt") - trainer.fit(model) - Correct usage: .. code-block:: python From 30a8f0cd2e63167f345d494d6396c610d1ec30d7 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 10 Dec 2024 11:32:30 +0000 Subject: [PATCH 7/7] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- docs/source-pytorch/common/checkpointing_basic.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source-pytorch/common/checkpointing_basic.rst b/docs/source-pytorch/common/checkpointing_basic.rst index c0c1c6b846d81..1026e972849ef 100644 --- a/docs/source-pytorch/common/checkpointing_basic.rst +++ b/docs/source-pytorch/common/checkpointing_basic.rst @@ -223,7 +223,7 @@ Correct usage: .. warning:: - The argument `resume_from_checkpoint` has been deprecated in versions of PyTorch Lightning >= 1.0.0. + The argument `resume_from_checkpoint` has been deprecated in versions of PyTorch Lightning >= 1.0.0. To resume training from a checkpoint, use the `ckpt_path` argument in the `fit()` method instead. Incorrect (deprecated) usage: