Update train_ms.py

This commit is contained in:
Stardust·减
2023-08-21 08:24:23 +08:00
committed by GitHub
parent b2d0ef33b6
commit ca4b00f340

View File

@@ -176,8 +176,8 @@ def train_and_evaluate(rank, epoch, hps, nets, optims, schedulers, scaler, loade
net_d.train()
for batch_idx, (x, x_lengths, spec, spec_lengths, y, y_lengths, speakers, tone, language, bert) in tqdm(enumerate(train_loader)):
if net_g.use_noise_scaled_mas:
current_mas_noise_scale = net_g.mas_noise_scale_initial - net_g.noise_scale_delta * global_step
net_g.current_mas_noise_scale = max(current_mas_noise_scale, 0.0)
current_mas_noise_scale = net_g.module.mas_noise_scale_initial - net_g.module.noise_scale_delta * global_step
net_g.module.current_mas_noise_scale = max(current_mas_noise_scale, 0.0)
x, x_lengths = x.cuda(rank, non_blocking=True), x_lengths.cuda(rank, non_blocking=True)
spec, spec_lengths = spec.cuda(rank, non_blocking=True), spec_lengths.cuda(rank, non_blocking=True)
y, y_lengths = y.cuda(rank, non_blocking=True), y_lengths.cuda(rank, non_blocking=True)