Skip to content

Commit

Permalink
Fix Namespace loading in PyYAML 5.4.x
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-boson committed Mar 25, 2021
1 parent 2cbdc01 commit 02d2dd9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).


## [UnReleased] - 2021-MM-DD

### Added
Expand Down Expand Up @@ -64,6 +63,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Added support for `precision=64`, enabling training with double precision ([#6595](https://github.com/PyTorchLightning/pytorch-lightning/pull/6595))


- Fix yaml loading with PyYAML=5.4.x ([#6666](https://github.com/PyTorchLightning/pytorch-lightning/issues/6666))


### Changed

- Renamed `pytorch_lightning.callbacks.swa` to `pytorch_lightning.callbacks.stochastic_weight_avg` ([#6259](https://github.com/PyTorchLightning/pytorch-lightning/pull/6259))
Expand Down
2 changes: 1 addition & 1 deletion pytorch_lightning/core/saving.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ def load_hparams_from_yaml(config_yaml: str, use_omegaconf: bool = True) -> Dict
return {}

with fs.open(config_yaml, "r") as fp:
hparams = yaml.load(fp, Loader=yaml.UnsafeLoader)
hparams = yaml.load(fp, Loader=yaml.Loader)

if _OMEGACONF_AVAILABLE:
if use_omegaconf:
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ numpy>=1.16.6
torch>=1.4
future>=0.17.1 # required for builtins in setup.py
# pyyaml>=3.13
PyYAML>=5.1, !=5.4.* # OmegaConf requirement >=5.1
PyYAML>=5.1 # OmegaConf requirement >=5.1
tqdm>=4.41.0
fsspec[http]>=0.8.1
tensorboard>=2.2.0
Expand Down

0 comments on commit 02d2dd9

Please sign in to comment.