From 23c7c27b05c94b1f5f389119ef9b8c578b898dc0 Mon Sep 17 00:00:00 2001 From: Nicolas Berger Date: Fri, 29 Apr 2022 13:52:42 +0200 Subject: [PATCH] Fix pickling of KFoldLoop (#12441) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * allow pickling of KFoldLoop * Update pl_examples/loop_examples/kfold.py Co-authored-by: Adrian Wälchli Co-authored-by: Nicolas Berger Co-authored-by: Kushashwa Ravi Shrimali --- CHANGELOG.md | 2 ++ pl_examples/loop_examples/kfold.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cac9172a62..165b7e3016 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Fixed an issue wrt recursive invocation of DDP configuration in hpu parallel plugin ([#12912](https://github.com/PyTorchLightning/pytorch-lightning/pull/12912)) - Fixed printing of ragged dictionaries in `Trainer.validate` and `Trainer.test` ([#12857](https://github.com/PyTorchLightning/pytorch-lightning/pull/12857)) - Fixed threading support for legacy loading of checkpoints ([#12814](https://github.com/PyTorchLightning/pytorch-lightning/pull/12814)) +- Fixed pickling of `KFoldLoop` ([#12441](https://github.com/PyTorchLightning/pytorch-lightning/pull/12441)) +- Stopped `optimizer_zero_grad` from being called after IPU execution ([#12913](https://github.com/PyTorchLightning/pytorch-lightning/pull/12913)) ## [1.6.2] - 2022-04-27 diff --git a/pl_examples/loop_examples/kfold.py b/pl_examples/loop_examples/kfold.py index 811ad409c2..229673ec78 100644 --- a/pl_examples/loop_examples/kfold.py +++ b/pl_examples/loop_examples/kfold.py @@ -239,6 +239,9 @@ class KFoldLoop(Loop): return getattr(self.fit_loop, key) return self.__dict__[key] + def __setstate__(self, state: Dict[str, Any]) -> None: + self.__dict__.update(state) + class LitImageClassifier(ImageClassifier): def __init__(self) -> None: