-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: make --continue_path work again (#131)
* fix: make --continue_path work again There were errors when loading models with `--continue_path` because #121 changed https://github.com/coqui-ai/Trainer/blob/47781f58d2714d8139dc00f57dbf64bcc14402b7/trainer/trainer.py#L1924 to save the `model_loss` as `{"train_loss": train_loss, "eval_loss": eval_loss}` instead of just a float. https://github.com/coqui-ai/Trainer/blob/47781f58d2714d8139dc00f57dbf64bcc14402b7/trainer/io.py#L195 still saves a float in `model_loss`, so loading the best model would still work fine. Loading a model via `--restore-path` also works fine because in that case the best loss is reset and not initialised from the saved model. This fix: - changes `save_best_model()` to also save a dict with train and eval loss, so that this is consistent everywhere - ensures that the model loader can handle both float and dict `model_loss` for backwards compatibility - adds relevant test cases * fixup! fix: make --continue_path work again
- Loading branch information
Showing
3 changed files
with
27 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters