From 5522621b46c306c4ec821bb72f5b12cf7fc28f09 Mon Sep 17 00:00:00 2001 From: lfchener Date: Fri, 20 Dec 2019 09:50:31 +0000 Subject: [PATCH] fix the text_data dim to fit the dim check in paddle develop version --- data_utils/data.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/data_utils/data.py b/data_utils/data.py index 0fb2a88b..a526da91 100644 --- a/data_utils/data.py +++ b/data_utils/data.py @@ -330,11 +330,10 @@ class DataGenerator(object): axis=0) masks.append(mask) padded_audios = np.array(padded_audios).astype('float32') + texts = np.expand_dims(np.array(texts).astype('int32'), axis=-1) if self._is_training: texts = fluid.create_lod_tensor( - np.array(texts).astype('int32'), - recursive_seq_lens=[text_lens], - place=self._place) + texts, recursive_seq_lens=[text_lens], place=self._place) audio_lens = np.array(audio_lens).astype('int64').reshape([-1, 1]) masks = np.array(masks).astype('float32') return padded_audios, texts, audio_lens, masks