DLS/C5/W1/Assignment 3: Improvise Jazz with LSTM/djmodel function

Hey Guys,

I’m trying to get the djmodel function to work but I’m stuck. I’m passing the reshaper x, the LSTM_cell x and [a, c], and the densor variable a.

I’ve printed both my model and the expected model:

----------- model -----------
[[‘InputLayer’, [(None, 30, 90)], 0], [‘TensorFlowOpLayer’, [(30, 90)], 0], [‘Reshape’, (30, 1, 90), 0], [‘InputLayer’, [(None, 64)], 0], [‘InputLayer’, [(None, 64)], 0], [‘TensorFlowOpLayer’, [(30, 90)], 0], [‘LSTM’, [(30, 64), (None, 64), (None, 64)], 39680, [(30, 1, 90), (None, 64), (None, 64)], ‘tanh’], [‘TensorFlowOpLayer’, [(30, 90)], 0], [‘TensorFlowOpLayer’, [(30, 90)], 0], [‘TensorFlowOpLayer’, [(30, 90)], 0], [‘TensorFlowOpLayer’, [(30, 90)], 0], [‘TensorFlowOpLayer’, [(30, 90)], 0], [‘TensorFlowOpLayer’, [(30, 90)], 0], [‘TensorFlowOpLayer’, [(30, 90)], 0], [‘TensorFlowOpLayer’, [(30, 90)], 0], [‘TensorFlowOpLayer’, [(30, 90)], 0], [‘TensorFlowOpLayer’, [(30, 90)], 0], [‘TensorFlowOpLayer’, [(30, 90)], 0], [‘TensorFlowOpLayer’, [(30, 90)], 0], [‘TensorFlowOpLayer’, [(30, 90)], 0], [‘TensorFlowOpLayer’, [(30, 90)], 0], [‘TensorFlowOpLayer’, [(30, 90)], 0], [‘TensorFlowOpLayer’, [(30, 90)], 0], [‘TensorFlowOpLayer’, [(30, 90)], 0], [‘TensorFlowOpLayer’, [(30, 90)], 0], [‘TensorFlowOpLayer’, [(30, 90)], 0], [‘TensorFlowOpLayer’, [(30, 90)], 0], [‘TensorFlowOpLayer’, [(30, 90)], 0], [‘TensorFlowOpLayer’, [(30, 90)], 0], [‘TensorFlowOpLayer’, [(30, 90)], 0], [‘TensorFlowOpLayer’, [(30, 90)], 0], [‘TensorFlowOpLayer’, [(30, 90)], 0], [‘TensorFlowOpLayer’, [(30, 90)], 0], [‘TensorFlowOpLayer’, [(30, 90)], 0], [‘TensorFlowOpLayer’, [(30, 90)], 0], [‘Dense’, (None, 90), 5850, ‘softmax’]]

----------- djmodel_out -----------
[[‘InputLayer’, [(None, 30, 90)], 0], [‘TensorFlowOpLayer’, [(None, 90)], 0], [‘Reshape’, (None, 1, 90), 0], [‘InputLayer’, [(None, 64)], 0], [‘InputLayer’, [(None, 64)], 0], [‘TensorFlowOpLayer’, [(None, 90)], 0], [‘LSTM’, [(None, 64), (None, 64), (None, 64)], 39680, [(None, 1, 90), (None, 64), (None, 64)], ‘tanh’], [‘TensorFlowOpLayer’, [(None, 90)], 0], [‘TensorFlowOpLayer’, [(None, 90)], 0], [‘TensorFlowOpLayer’, [(None, 90)], 0], [‘TensorFlowOpLayer’, [(None, 90)], 0], [‘TensorFlowOpLayer’, [(None, 90)], 0], [‘TensorFlowOpLayer’, [(None, 90)], 0], [‘TensorFlowOpLayer’, [(None, 90)], 0], [‘TensorFlowOpLayer’, [(None, 90)], 0], [‘TensorFlowOpLayer’, [(None, 90)], 0], [‘TensorFlowOpLayer’, [(None, 90)], 0], [‘TensorFlowOpLayer’, [(None, 90)], 0], [‘TensorFlowOpLayer’, [(None, 90)], 0], [‘TensorFlowOpLayer’, [(None, 90)], 0], [‘TensorFlowOpLayer’, [(None, 90)], 0], [‘TensorFlowOpLayer’, [(None, 90)], 0], [‘TensorFlowOpLayer’, [(None, 90)], 0], [‘TensorFlowOpLayer’, [(None, 90)], 0], [‘TensorFlowOpLayer’, [(None, 90)], 0], [‘TensorFlowOpLayer’, [(None, 90)], 0], [‘TensorFlowOpLayer’, [(None, 90)], 0], [‘TensorFlowOpLayer’, [(None, 90)], 0], [‘TensorFlowOpLayer’, [(None, 90)], 0], [‘TensorFlowOpLayer’, [(None, 90)], 0], [‘TensorFlowOpLayer’, [(None, 90)], 0], [‘TensorFlowOpLayer’, [(None, 90)], 0], [‘TensorFlowOpLayer’, [(None, 90)], 0], [‘TensorFlowOpLayer’, [(None, 90)], 0], [‘TensorFlowOpLayer’, [(None, 90)], 0], [‘Dense’, (None, 90), 5850, ‘softmax’]]

And I’m getting the following error:

Test failed at index 1
Expected value

[‘TensorFlowOpLayer’, [(None, 90)], 0]

does not match the input value:

[‘TensorFlowOpLayer’, [(30, 90)], 0]

Anyone any idea as to what I might be doing wrong?

It looks like you are hard-coding the number of samples on the dimension of the input for that layer. They just gave you the three Input statements that define that and those should not have required any modification. But maybe I’m just not thinking creatively enough yet about how that error might arise …

1 Like