Skip to content

Commit

Permalink
mel-spec transform infinity values bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanvovk committed Nov 1, 2020
1 parent 6be2f4c commit bc75d3a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions data.py
Expand Up @@ -72,5 +72,7 @@ def __init__(self, **kwargs):
self.torchaudio_backend = MelSpectrogram(**kwargs)

def forward(self, x):
outputs = self.torchaudio_backend(x)
return outputs[..., :-1].log10()
outputs = self.torchaudio_backend(x).log10()
mask = torch.isinf(outputs)
outputs[mask] = 0
return outputs[..., :-1]

0 comments on commit bc75d3a

Please sign in to comment.