Resuming and Fine-tuning

The --resume option to the train.sh script continues training, with the optimizer state, from --checkpoint if given, otherwise from the last checkpoint in the output directory. Training continues from the checkpoint’s step, but the data order differs from an uninterrupted run.

The --fine_tune option ensures that training starts anew, with a new learning rate schedule and optimizer state, from the --checkpoint.

Resuming also restores the state of the training schedules (delay penalty, STAR and WST), so for example a penalty that has already ramped up stays ramped up rather than restarting from its initial value. --fine_tune restarts these schedules.

To freeze the encoder weights during training change the enc_freeze option in the config file to:

rnnt:
  enc_freeze: true

Fine-tuning a multilingual model on a subset of languages

If you trained a multilingual model with, say, langs: [en, fr, de] (see Training on multiple languages), you can resume its training on only some of those languages, for example just French, by adding ft_langs to the model config:

langs: [en, fr, de]
ft_langs: [fr]

ft_langs is optional and, when present, selects which of the manifest’s languages are loaded as training data, in place of langs. Crucially, langs itself is left untouched, so the sentencepiece tokenizer, ngram model, and mel stats are unaffected and stay identical to the original model - only the training data changes.

Then train from the multilingual checkpoint with --checkpoint <path> and --resume or --fine_tune, as above, and set --training_steps: it is the step to stop at. --resume carries on from the checkpoint’s step, so set it beyond that (training won’t start otherwise), while --fine_tune starts again from step 1, so it is the length of the fine-tune.

Note

Keep the rest of the model config as it was for the multilingual model, in particular langs, the tokenizer, the mel stats and the n-gram: the checkpoint was trained with them.

ft_langs has no effect on validation, which continues to use whatever --val_manifests/--val_standardizer_lang are passed on the command line.