dspavankumar / keras-kaldi

Keras Interface for Kaldi ASR
GNU General Public License v3.0
121 stars 41 forks source link

Problem with 'dataGenSequences' object has no attribute shape #16

Open Riccorl opened 5 years ago

Riccorl commented 5 years ago

Hi, I'm trying to run the run_kt_LSTM.sh but it gives me this error:

File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/training_generator.py", line 377, in convert_to_generator_like
    num_samples = int(nest.flatten(data)[0].shape[0])
AttributeError: 'dataGenSequences' object has no attribute 'shape'

I don't know how to solve it.

dspavankumar commented 5 years ago

Sorry for being so late, the script should work with Tensorflow 1.x. Are you using Tensorflow 2.0?

Riccorl commented 5 years ago

It seems it doesn't work with 1.13. It works with 1.12 though.

swang423 commented 5 years ago

dataGenSequences.py has minor issues with stride_trick. As far as I understand, the features are concatenated into a big matrix of features, then the stride_trick reshapes the 2D feature matrix into a 3D tensor in next(). However, this means that the beginning of utt02 will be part of the last few frames in utt01. Likewise, the end of utt01 will be in the first few frames in utt02. This may be acceptable in clean TIMIT experiment since most utterance start/end with silence frames, but it will generate unreliable frames for other corpora (especially those with noisy recordings).

Maybe we need to reshape the utt-level features into 3D tensor first before concat-ing them into a big matrix for feature randomization.