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

Commit

Permalink
Fix bug in GradientDescentTrainer when validation data is absent (#4811)
Browse files Browse the repository at this point in the history
* Fix issue in GradientDescentTrainer, when validation data is absent

* Prevent an error when GradientDescentTrainer is constructed with
validation_data_loader=None and learning_rate_scheduler!=None

* Update CHANGELOG.md

* Fix issue with formatting
  • Loading branch information
IINemo committed Nov 23, 2020
1 parent f353c6c commit 5b30658
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- Added links to source code in docs.
- Fixed issue with GradientDescentTrainer when constructed with validation_data_loader==None and learning_rate_scheduler!=None.


## [v1.2.2](https://github.com/allenai/allennlp/releases/tag/v1.2.2) - 2020-11-17
Expand Down
2 changes: 1 addition & 1 deletion allennlp/training/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,7 @@ def _try_train(self) -> Dict[str, Any]:
logger.info("Beginning training.")

val_metrics: Dict[str, float] = {}
this_epoch_val_metric: float
this_epoch_val_metric: float = 0.0
metrics: Dict[str, Any] = {}
epochs_trained = 0
training_start_time = time.time()
Expand Down

0 comments on commit 5b30658

Please sign in to comment.