Fix saving native AMP scaler state (#1777)

Saving was introduced in #1561.
This commit is contained in:
Fabio Natanael Kepler
2020-05-11 21:38:37 -04:00
committed by GitHub
parent eeb411144f
commit d120f97896
2 changed files with 5 additions and 2 deletions
+3
View File
@@ -46,6 +46,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Fixed lr key name in case of param groups in LearningRateLogger ([#1719](https://github.com/PyTorchLightning/pytorch-lightning/pull/1719))
- Fixed saving native AMP scaler state (introduced in [#1561](https://github.com/PyTorchLightning/pytorch-lightning/pull/1561))
## [0.7.5] - 2020-04-27
### Changed
+2 -2
View File
@@ -338,8 +338,8 @@ class TrainerIOMixin(ABC):
checkpoint['state_dict'] = model.state_dict()
# restore native amp scaling
if self.use_amp and self.use_native_amp and 'native_amp_scaling_state' in checkpoint:
# save native amp scaling
if self.use_amp and self.use_native_amp:
checkpoint['native_amp_scaling_state'] = self.scaler.state_dict()
if hasattr(model, "hparams"):