# Error with music\_inference\_model

**URL:** <https://community.deeplearning.ai/t/error-with-music-inference-model/18097>\
**Category:** Sequence Models\
**Tags:** coursera-platform\
**Created:** [June 29, 2021, 7:02pm UTC](https://community.deeplearning.ai/t/error-with-music-inference-model/18097 "2021-06-29T19:02:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![HarshShah03](https://avatars.discourse-cdn.com/v4/letter/h/e0b2c6/32.png) [@HarshShah03](https://community.deeplearning.ai/u/HarshShah03)\
**Post date:** [June 29, 2021, 7:02pm UTC](https://community.deeplearning.ai/t/error-with-music-inference-model/18097/1 "2021-06-29T19:02:11Z")

</div>

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 :  
#UNIT TEST  
inference\_summary = summary(inference\_model)  
comparator(inference\_summary, music\_inference\_model\_out)

Any kind of help is highly appreciated, thanks!

---

<div class="post-metadata">

**Author:** ![Kic](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/kic/32/76339_2.png) [@Kic](https://community.deeplearning.ai/u/Kic)\
**Post date:** [June 29, 2021, 8:46pm UTC](https://community.deeplearning.ai/t/error-with-music-inference-model/18097/2 "2021-06-29T20:46:48Z")

</div>

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](https://www.tensorflow.org/api_docs/python/tf/math/argmax) 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.
