From 769f0acc53c5b602a97ff500368dc4a6e5ca9d9e Mon Sep 17 00:00:00 2001 From: James Betker Date: Sat, 14 Aug 2021 17:23:15 -0600 Subject: [PATCH] Moar fix --- codes/data/audio/nv_tacotron_dataset.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codes/data/audio/nv_tacotron_dataset.py b/codes/data/audio/nv_tacotron_dataset.py index c1052b8a..8a9d6361 100644 --- a/codes/data/audio/nv_tacotron_dataset.py +++ b/codes/data/audio/nv_tacotron_dataset.py @@ -88,7 +88,7 @@ class TextMelLoader(torch.utils.data.Dataset): if sampling_rate != self.input_sample_rate: if sampling_rate < self.input_sample_rate: print(f'{filename} has a sample rate of {sampling_rate} which is lower than the requested sample rate of {self.input_sample_rate}. This is not a good idea.') - audio = torch.nn.functional.interpolate(audio.unsqueeze(0).unsqueeze(1), scale_factor=self.input_sample_rate/sampling_rate, mode='area', recompute_scale_factor=False) + audio = torch.nn.functional.interpolate(audio.unsqueeze(0).unsqueeze(1), scale_factor=self.input_sample_rate/sampling_rate, mode='area', recompute_scale_factor=False).squeeze() if (audio.min() < -1).any() or (audio.max() > 1).any(): print(f"Error with audio ranging for {filename}; min={audio.min()} max={audio.max()}") return None