Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Commit

Permalink
ensure parameters that are actual dictionaries get logged (#4697)
Browse files Browse the repository at this point in the history
  • Loading branch information
epwalsh authored Oct 3, 2020
1 parent eb7f256 commit 3506e3f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
if the "href" part of the link (the part inside the `()`) was on a new line.
- Changed how gradients are zeroed out with an optimization. See [this video from NVIDIA](https://www.youtube.com/watch?v=9mS1fIYj1So)
at around the 9 minute mark.
- Fixed a bug where parameters to a `FromParams` class that are dictionaries wouldn't get logged
when an instance is instantiated `from_params`.


## [v1.1.0](https://github.com/allenai/allennlp/releases/tag/v1.1.0) - 2020-09-08
Expand Down
2 changes: 1 addition & 1 deletion allennlp/common/from_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ def constructor(**kwargs):
else:
# Pass it on as is and hope for the best. ¯\_(ツ)_/¯
if isinstance(popped_params, Params):
return popped_params.as_dict(quiet=True)
return popped_params.as_dict()
return popped_params


Expand Down
6 changes: 0 additions & 6 deletions allennlp/common/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,12 +383,6 @@ def log_recursively(parameters, history):
else:
logger.info(f"{history}{key} = {value}")

logger.info(
"Converting Params object to dict; logging of default "
"values will not occur when dictionary parameters are "
"used subsequently."
)
logger.info("CURRENTLY DEFINED PARAMETERS: ")
log_recursively(self.params, self.history)
return params_as_dict

Expand Down

0 comments on commit 3506e3f

Please sign in to comment.