From 631fbdcb8e158733b4ec1c9996c6c7cc105cd114 Mon Sep 17 00:00:00 2001 From: Markus Toman Date: Fri, 7 Feb 2020 11:08:21 +0100 Subject: [PATCH 1/3] Fix vocoder normalization when no vocoder is used When G&L is used, ap_vocoder is None and crashes --- synthesize.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synthesize.py b/synthesize.py index cb0ee8af..eec022ab 100644 --- a/synthesize.py +++ b/synthesize.py @@ -31,8 +31,8 @@ def tts(model, postnet_output = ap.out_linear_to_mel(postnet_output.T).T # correct if there is a scale difference b/w two models postnet_output = ap._denormalize(postnet_output) - postnet_output = ap_vocoder._normalize(postnet_output) if use_vocoder_model: + postnet_output = ap_vocoder._normalize(postnet_output) vocoder_input = torch.FloatTensor(postnet_output.T).unsqueeze(0) waveform = vocoder_model.generate( vocoder_input.cuda() if use_cuda else vocoder_input, From 3f54c39b0a4bb4678aec99a2e6b13b825387d712 Mon Sep 17 00:00:00 2001 From: Markus Toman Date: Fri, 7 Feb 2020 12:35:03 +0100 Subject: [PATCH 2/3] Pacify pylint --- synthesize.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/synthesize.py b/synthesize.py index eec022ab..47b409ef 100644 --- a/synthesize.py +++ b/synthesize.py @@ -30,9 +30,9 @@ def tts(model, if C.model == "Tacotron" and use_vocoder_model: postnet_output = ap.out_linear_to_mel(postnet_output.T).T # correct if there is a scale difference b/w two models - postnet_output = ap._denormalize(postnet_output) + postnet_output = ap._denormalize(postnet_output) # pylint: disable=W021 if use_vocoder_model: - postnet_output = ap_vocoder._normalize(postnet_output) + postnet_output = ap_vocoder._normalize(postnet_output) # pylint: disable=W021 vocoder_input = torch.FloatTensor(postnet_output.T).unsqueeze(0) waveform = vocoder_model.generate( vocoder_input.cuda() if use_cuda else vocoder_input, From 8f37ea9b84c556440c0fca3c7682f101be03cb0a Mon Sep 17 00:00:00 2001 From: Markus Toman Date: Fri, 7 Feb 2020 12:58:58 +0100 Subject: [PATCH 3/3] Pacify pylint even more --- synthesize.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/synthesize.py b/synthesize.py index 47b409ef..8312d78d 100644 --- a/synthesize.py +++ b/synthesize.py @@ -1,3 +1,4 @@ +# pylint: disable=redefined-outer-name, unused-argument import os import time import argparse @@ -30,9 +31,9 @@ def tts(model, if C.model == "Tacotron" and use_vocoder_model: postnet_output = ap.out_linear_to_mel(postnet_output.T).T # correct if there is a scale difference b/w two models - postnet_output = ap._denormalize(postnet_output) # pylint: disable=W021 + postnet_output = ap._denormalize(postnet_output) # pylint: disable=protected-access if use_vocoder_model: - postnet_output = ap_vocoder._normalize(postnet_output) # pylint: disable=W021 + postnet_output = ap_vocoder._normalize(postnet_output) # pylint: disable=protected-access vocoder_input = torch.FloatTensor(postnet_output.T).unsqueeze(0) waveform = vocoder_model.generate( vocoder_input.cuda() if use_cuda else vocoder_input,