From 9bbc9e924641670be4d3a5f08794a7c265896747 Mon Sep 17 00:00:00 2001 From: Plachta Date: Mon, 12 Jun 2023 19:20:32 +0800 Subject: [PATCH] Added capability of continue training from previous checkpoints --- finetune_speaker_v2.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/finetune_speaker_v2.py b/finetune_speaker_v2.py index 5afbae1..d466c84 100644 --- a/finetune_speaker_v2.py +++ b/finetune_speaker_v2.py @@ -100,10 +100,9 @@ def run(rank, n_gpus, hps): # load existing model if hps.cont: try: - _, _, _, epoch_str = utils.load_checkpoint(utils.latest_checkpoint_path(hps.model_dir, "G_*.pth"), net_g, None) - _, _, _, epoch_str = utils.load_checkpoint(utils.latest_checkpoint_path(hps.model_dir, "D_*.pth"), net_d, None) - epoch_str = 1 - global_step = 0 + _, _, _, epoch_str = utils.load_checkpoint("./pretrained_models/G_latest.pth", net_g, None) + _, _, _, epoch_str = utils.load_checkpoint("./pretrained_models/D_latest.pth", net_d, None) + global_step = epoch_str * hps.train.batch_size except: _, _, _, epoch_str = utils.load_checkpoint("./pretrained_models/G_0.pth", net_g, None) _, _, _, epoch_str = utils.load_checkpoint("./pretrained_models/D_0.pth", net_d, None)