diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e12875f45989..176b1826b3719 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). ### Fixed - Fixed bug related to type cheking of `ReduceLROnPlateau` lr schedulers([#1114](https://github.com/PyTorchLightning/pytorch-lightning/issues/1114)) +- Fixed a bug to ensure lightning checkpoints to be backward compatible ([#1132](https://github.com/PyTorchLightning/pytorch-lightning/pull/1132)) ## [0.7.1] - 2020-03-07 diff --git a/pytorch_lightning/core/lightning.py b/pytorch_lightning/core/lightning.py index 9542783d38679..d5b408423dce1 100644 --- a/pytorch_lightning/core/lightning.py +++ b/pytorch_lightning/core/lightning.py @@ -1396,7 +1396,7 @@ def _load_model_state(cls, checkpoint: Dict[str, Any]) -> 'LightningModule': if cls_takes_hparams: if ckpt_hparams is not None: - is_namespace = checkpoint.get('hparams_type') == 'namespace' + is_namespace = checkpoint.get('hparams_type', 'namespace') == 'namespace' hparams = Namespace(**ckpt_hparams) if is_namespace else ckpt_hparams else: warnings.warn(