From e54f23befd7a3b0c25e1d9d1599e9e61108fabb3 Mon Sep 17 00:00:00 2001 From: chenfeiyu Date: Tue, 13 Apr 2021 16:17:46 +0800 Subject: [PATCH] update collate function, data loader not does not convert nested list into numpy array. --- examples/tacotron2/ljspeech.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/tacotron2/ljspeech.py b/examples/tacotron2/ljspeech.py index 6efbea6..ad6cfbc 100644 --- a/examples/tacotron2/ljspeech.py +++ b/examples/tacotron2/ljspeech.py @@ -86,9 +86,10 @@ class LJSpeechCollector(object): for i, _ in sorted( zip(mel_lens, text_lens), key=lambda x: x[1], reverse=True) ] + mel_lens = np.array(mel_lens, dtype=np.int64) - text_lens = sorted(text_lens, reverse=True) + text_lens = np.array(sorted(text_lens, reverse=True), dtype=np.int64) # Pad sequence with largest len of the batch texts = batch_text_id(texts, pad_id=self.padding_idx)