Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AssertionError assert(torch.min(y.data) >= -1) #19

Open
Truong-Thanh-Quang opened this issue Mar 4, 2020 · 0 comments
Open

AssertionError assert(torch.min(y.data) >= -1) #19

Truong-Thanh-Quang opened this issue Mar 4, 2020 · 0 comments

Comments

@Truong-Thanh-Quang
Copy link

Truong-Thanh-Quang commented Mar 4, 2020

I ran python3 prepare_data.py with my own data (22050, 16bit, mono), AssertionError occured.

HBox(children=(FloatProgress(value=0.0, max=28825.0), HTML(value='')))
Traceback (most recent call last):
File "prepare_data.py", line 103, in
text, char_seq, phone_seq, melspec, wav = save_file(k)
File "prepare_data.py", line 85, in save_file
melspec, wav = get_mel(wav_name)
File "prepare_data.py", line 75, in get_mel
melspec = stft.mel_spectrogram(wav.unsqueeze(0))
File "/works/Transformer-TTS/layers.py", line 72, in mel_spectrogram
assert(torch.min(y.data) >= -1)
AssertionError

Should I normalize wave data array into range [-1,1] before pass the array to FloatTensor in get_mel() function?

def get_mel(filename):
wav, sr = librosa.load(filename, sr=22050)
wav = torch.FloatTensor(wav.astype(np.float32))
melspec = stft.mel_spectrogram(wav.unsqueeze(0))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant