diff --git a/TTS/trainer.py b/TTS/trainer.py index 40d1ab6f..9fcd77a7 100644 --- a/TTS/trainer.py +++ b/TTS/trainer.py @@ -647,7 +647,7 @@ class Trainer: optimizer.step() # pytorch skips the step when the norm is 0. So ignore the norm value when it is NaN - if isinstance(grad_norm ,torch.Tensor) and (torch.isnan(grad_norm) or torch.isinf(grad_norm)): + if isinstance(grad_norm, torch.Tensor) and (torch.isnan(grad_norm) or torch.isinf(grad_norm)): grad_norm = 0 step_time = time.time() - step_start_time