Sequence Models: Jazz improvisation with LSTM

I have been blocked with this error for a while and read related questions. All good until I call the summary function


inference_summary = summary(inference_model)
comparator(inference_summary, music_inference_model_out)

AttributeError: The layer “lstm” has multiple inbound nodes, with different output shapes. Hence the notion of “output shape” is ill-defined for the layer. Use get_output_shape_at(node_index) instead.

This are my dims from debugging:
this is x0:
Tensor(“input_3:0”, shape=(None, 1, 90), dtype=float32)
This is c0:
Tensor(“c0_2:0”, shape=(None, 64), dtype=float32)
This is a0:
Tensor(“a0_2:0”, shape=(None, 64), dtype=float32)

I’m blocked.


Hi @Edu4rd

If you passed x0, a0 and c0 as inputs to create the model than you have passed the correct inputs to the model.

I suggest you check the parameters pass to the functions within the For loop, the comment lines and the implementation notes would help. If you still not sure, you are welcome to post that section of the code in a Direct message to me, I will have a look for you.

Hi @Edu4rd ,

In the call to tf.math.argmax(), you need to set the axis to the last axis, ie axis = -1.

Done. Thank you!
So simple and soo invisible to me. :slight_smile: