mirror of https://github.com/coqui-ai/TTS.git
Add the ValueError in the restore checkpoint exception to avoid problems with the optimizer restauration when new keys are addition
This commit is contained in:
parent
bbdb5c38e6
commit
0bdfd3cb50
|
@ -453,7 +453,7 @@ class Trainer:
|
||||||
if "scaler" in checkpoint and self.use_amp_scaler and checkpoint["scaler"]:
|
if "scaler" in checkpoint and self.use_amp_scaler and checkpoint["scaler"]:
|
||||||
print(" > Restoring Scaler...")
|
print(" > Restoring Scaler...")
|
||||||
scaler = _restore_list_objs(checkpoint["scaler"], scaler)
|
scaler = _restore_list_objs(checkpoint["scaler"], scaler)
|
||||||
except (KeyError, RuntimeError):
|
except (KeyError, RuntimeError, ValueError):
|
||||||
print(" > Partial model initialization...")
|
print(" > Partial model initialization...")
|
||||||
model_dict = model.state_dict()
|
model_dict = model.state_dict()
|
||||||
model_dict = set_init_dict(model_dict, checkpoint["model"], config)
|
model_dict = set_init_dict(model_dict, checkpoint["model"], config)
|
||||||
|
|
Loading…
Reference in New Issue