Fix pickling of KFoldLoop (#12441)

* allow pickling of KFoldLoop

* Update pl_examples/loop_examples/kfold.py

Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>
Co-authored-by: Nicolas Berger <nicolas.berger@inait.ai>
Co-authored-by: Kushashwa Ravi Shrimali <kushashwaravishrimali@gmail.com>
This commit is contained in:
Nicolas Berger 2022-04-29 13:52:42 +02:00 committed by lexierule
parent b0a9b5ab2d
commit 23c7c27b05
2 changed files with 5 additions and 0 deletions

View File

@ -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 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 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 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 ## [1.6.2] - 2022-04-27

View File

@ -239,6 +239,9 @@ class KFoldLoop(Loop):
return getattr(self.fit_loop, key) return getattr(self.fit_loop, key)
return self.__dict__[key] return self.__dict__[key]
def __setstate__(self, state: Dict[str, Any]) -> None:
self.__dict__.update(state)
class LitImageClassifier(ImageClassifier): class LitImageClassifier(ImageClassifier):
def __init__(self) -> None: def __init__(self) -> None: