From f251dc8c0e6a0e6cdcacaca17c5590726d29b59a Mon Sep 17 00:00:00 2001 From: Alexander Korolev Date: Thu, 21 Jan 2021 21:16:30 +0100 Subject: [PATCH] Update train_tacotron.py When attempting to fine-tune a model with "prenet_type": "bn" that was originally trained with "prenet_type": "original", a RuntimeError is thrown that stops the training. By catching the RuntimeError, the required layers can be partially restored and the training will continue without any problems. --- TTS/bin/train_tacotron.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TTS/bin/train_tacotron.py b/TTS/bin/train_tacotron.py index 38017b92..ccb35a7c 100644 --- a/TTS/bin/train_tacotron.py +++ b/TTS/bin/train_tacotron.py @@ -549,7 +549,7 @@ def main(args): # pylint: disable=redefined-outer-name scaler.load_state_dict(checkpoint["scaler"]) if c.reinit_layers: raise RuntimeError - except KeyError: + except (KeyError, RuntimeError): print(" > Partial model initialization.") model_dict = model.state_dict() model_dict = set_init_dict(model_dict, checkpoint['model'], c)