CNTK icon indicating copy to clipboard operation
CNTK copied to clipboard

Issue with dynamic axes in LSTM

Open shayben opened this issue 9 years ago • 1 comments

Hi, I am trying to train a seq-to-seq (no delay) LSTM network. I am running into issues with dynamic axes being out of alignment, and the documentation on this didn't get me very far. num_output_classes = 12, LSTM_dim = 32, cell_dim = 32 lstm_classifier = Sequential([ Recurrence(LSTM(LSTM_dim, LSTM_dim, enable_self_stabilization=True)), sequence.last, Dense(64, activation=relu), Dense(num_output_classes, activation=sigmoid)]) features = sequence.input(shape=input_dim) label = sequence.input(num_output_classes, is_sparse=True) classifier_output = lstm_classifier(features) ce = cross_entropy_with_softmax(classifier_output, label)

Last line crashes with

RuntimeError: Operation 'TransposeTimes': Operand 'Placeholder('Placeholder4380', [#], [12])' has dynamic axes, that do not match the dynamic axes '[*, #]' of the other operands.

What have I done wrong?

shayben avatar Jun 08 '17 11:06 shayben

Ended up following this https://github.com/Microsoft/CNTK/blob/master/Examples/Speech/AN4/Python/HTK_LSTM_Truncated_Distributed.py. I still don't understand why my design didn't work but this one does.

shayben avatar Jun 08 '17 12:06 shayben