Skip to content

Commit

Permalink
Update train.py
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinWang676 authored Sep 26, 2023
1 parent cc2b0c6 commit 20ddcb5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions train.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,12 +383,15 @@ def train_and_evaluate(rank, epoch, hps, nets, optims, schedulers, scaler, loade
utils.save_checkpoint(net_dur_disc, optim_dur_disc, hps.train.learning_rate, epoch,
os.path.join(hps.model_dir, "DUR_{}.pth".format(global_step)))

prev_g = os.path.join(hps.model_dir, "G_{}.pth".format(global_step - 2 * hps.train.eval_interval))
prev_d = os.path.join(hps.model_dir, "D_{}.pth".format(global_step - 2 * hps.train.eval_interval))
prev_g = os.path.join(hps.model_dir, "G_{}.pth".format(global_step - 3 * hps.train.eval_interval))
prev_d = os.path.join(hps.model_dir, "D_{}.pth".format(global_step - 3 * hps.train.eval_interval))
prev_dur = os.path.join(hps.model_dir, "DUR_{}.pth".format(global_step - 3 * hps.train.eval_interval))
if os.path.exists(prev_g):
os.remove(prev_g)
if os.path.exists(prev_d):
os.remove(prev_d)
if os.path.exists(prev_dur):
os.remove(prev_dur)

global_step += 1

Expand Down

0 comments on commit 20ddcb5

Please sign in to comment.