Skip to content

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

@Truong-Thanh-Quang

Description

@Truong-Thanh-Quang

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))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions