keras-kaldi
keras-kaldi copied to clipboard
Problem with 'dataGenSequences' object has no attribute shape
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.
Sorry for being so late, the script should work with Tensorflow 1.x. Are you using Tensorflow 2.0?
It seems it doesn't work with 1.13. It works with 1.12 though.
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.