From effec215481ff33678ab6d9fc87eaa8981e486a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stardust=C2=B7=E5=87=8F?= <2225664821@qq.com> Date: Wed, 23 Aug 2023 16:46:59 +0800 Subject: [PATCH] Update train_ms.py --- train_ms.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/train_ms.py b/train_ms.py index 8507100..202a6b1 100644 --- a/train_ms.py +++ b/train_ms.py @@ -216,7 +216,7 @@ def train_and_evaluate(rank, epoch, hps, nets, optims, schedulers, scaler, loade with autocast(enabled=hps.train.fp16_run): y_hat, l_length, attn, ids_slice, x_mask, z_mask, \ - (z, z_p, m_p, logs_p, m_q, logs_q), (logw, logw_) = net_g(x, x_lengths, spec, spec_lengths, speakers, tone, language, bert) + (z, z_p, m_p, logs_p, m_q, logs_q), (hidden_x, logw, logw_) = net_g(x, x_lengths, spec, spec_lengths, speakers, tone, language, bert) mel = spec_to_mel_torch( spec, hps.data.filter_length, @@ -244,9 +244,9 @@ def train_and_evaluate(rank, epoch, hps, nets, optims, schedulers, scaler, loade loss_disc, losses_disc_r, losses_disc_g = discriminator_loss(y_d_hat_r, y_d_hat_g) loss_disc_all = loss_disc if net_dur_disc is not None: - y_dur_hat_r, y_dur_hat_g = net_dur_disc(logw, logw_.detach()) + y_dur_hat_r, y_dur_hat_g = net_dur_disc(hidden_x, x_mask, logw, logw_.detach()) with autocast(enabled=False): - # TODO: I think need to mean using the mask, but for now, just mean all + # TODO: I think need to mean using the mask, but for now, just mean all loss_dur_disc, losses_dur_disc_r, losses_dur_disc_g = discriminator_loss(y_dur_hat_r, y_dur_hat_g) loss_dur_disc_all = loss_dur_disc optim_dur_disc.zero_grad() @@ -265,7 +265,7 @@ def train_and_evaluate(rank, epoch, hps, nets, optims, schedulers, scaler, loade # Generator y_d_hat_r, y_d_hat_g, fmap_r, fmap_g = net_d(y, y_hat) if net_dur_disc is not None: - y_dur_hat_r, y_dur_hat_g = net_dur_disc(x, x_mask, logw, logw_) + y_dur_hat_r, y_dur_hat_g = net_dur_disc(hidden_x, x_mask, logw, logw_) with autocast(enabled=False): loss_dur = torch.sum(l_length.float()) loss_mel = F.l1_loss(y_mel, y_hat_mel) * hps.train.c_mel