From 0bdfd3cb5076ec967e27ed58ed191232e0a1773f Mon Sep 17 00:00:00 2001 From: Edresson Date: Sat, 28 Aug 2021 10:11:33 -0300 Subject: [PATCH] Add the ValueError in the restore checkpoint exception to avoid problems with the optimizer restauration when new keys are addition --- TTS/trainer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TTS/trainer.py b/TTS/trainer.py index 2175875c..e8911ba3 100644 --- a/TTS/trainer.py +++ b/TTS/trainer.py @@ -453,7 +453,7 @@ class Trainer: if "scaler" in checkpoint and self.use_amp_scaler and checkpoint["scaler"]: print(" > Restoring Scaler...") scaler = _restore_list_objs(checkpoint["scaler"], scaler) - except (KeyError, RuntimeError): + except (KeyError, RuntimeError, ValueError): print(" > Partial model initialization...") model_dict = model.state_dict() model_dict = set_init_dict(model_dict, checkpoint["model"], config)