From 6c7c1d933ffe2217edc74afadff7eec0078d6d16 Mon Sep 17 00:00:00 2001 From: liujing04 <129054828+liujing04@users.noreply.github.com> Date: Mon, 10 Apr 2023 11:08:26 +0800 Subject: [PATCH] Update train_nsf_sim_cache_sid_load_pretrain.py --- train_nsf_sim_cache_sid_load_pretrain.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/train_nsf_sim_cache_sid_load_pretrain.py b/train_nsf_sim_cache_sid_load_pretrain.py index 3a94e82..d2d9c35 100644 --- a/train_nsf_sim_cache_sid_load_pretrain.py +++ b/train_nsf_sim_cache_sid_load_pretrain.py @@ -501,13 +501,12 @@ def train_and_evaluate( if rank == 0: logger.info("====> Epoch: {}".format(epoch)) - if(epoch>=hps.total_epoch): - if rank == 0: - logger.info("Training is done. The program is closed.") - from process_ckpt import savee#def savee(ckpt,sr,if_f0,name,epoch): - if hasattr(net_g, 'module'):ckpt = net_g.module.state_dict() - else:ckpt = net_g.state_dict() - print("saving final ckpt:",savee(ckpt,hps.sample_rate,hps.if_f0,hps.name,epoch)) + if(epoch>=hps.total_epoch and rank == 0): + logger.info("Training is done. The program is closed.") + from process_ckpt import savee#def savee(ckpt,sr,if_f0,name,epoch): + if hasattr(net_g, 'module'):ckpt = net_g.module.state_dict() + else:ckpt = net_g.state_dict() + logger.info("saving final ckpt:%s"%(savee(ckpt,hps.sample_rate,hps.if_f0,hps.name,epoch))) os._exit(2333333)