Error with music_inference_model

The error that keeps coming up is:
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.

My code for music_inference_model is:

{mentor edit: code removed - not allowed by the course Honor Code}

The error comes up while trying to run :
inference_summary = summary(inference_model)
comparator(inference_summary, music_inference_model_out)

Any kind of help is highly appreciated, thanks!

Hi @HarshShah03 ,

You coded incorrectly in two places:

  1. tf.math.argmax(), the parameter axis shouldn’t be set to -1
    Please refer to this link from the official doc for details.
  2. n_values should not be used as depth for the call of tf.one_hot(). x has the dimension of n_values, so the depth should just be 1.

Please be reminded of the honour code policy and do not post your code publicly.

1 Like