fix the bug in data.py

pull/415/head
lfchener 5 years ago
parent ebf2f53941
commit bf5f7cebb4

@ -330,8 +330,8 @@ 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 = np.expand_dims(np.array(texts).astype('int32'), axis=-1)
texts = fluid.create_lod_tensor(
texts, recursive_seq_lens=[text_lens], place=self._place)
audio_lens = np.array(audio_lens).astype('int64').reshape([-1, 1])

@ -48,7 +48,7 @@ add_arg('vocab_path', str,
'data/librispeech/eng_vocab.txt',
"Filepath of vocabulary.")
add_arg('model_path', str,
'./checkpoints/libri/params.latest.tar.gz',
'./checkpoints/libri/step_final',
"If None, the training starts from scratch, "
"otherwise, it resumes from the pre-trained model.")
add_arg('lang_model_path', str,

Loading…
Cancel
Save