keras-kaldi icon indicating copy to clipboard operation
keras-kaldi copied to clipboard

Problem with 'dataGenSequences' object has no attribute shape

Open Riccorl opened this issue 5 years ago • 3 comments

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.

Riccorl avatar Mar 12 '19 17:03 Riccorl

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

dspavankumar avatar Apr 26 '19 10:04 dspavankumar

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

Riccorl avatar Apr 26 '19 13:04 Riccorl

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.

swang423 avatar Jun 11 '19 12:06 swang423