Inference model - Tensorflow arguments : Improvise_a_Jazz_Solo_with_an_LSTM_Network_v4

I am running into an error

ValueError: Layer lstm expects 19 inputs, but it received 3 input tensors. Inputs received: [<tf.Tensor ‘input_12:0’ shape=(None, 1, 90) dtype=float32>, <tf.Tensor ‘a0_11:0’ shape=(None, 64) dtype=float32>, <tf.Tensor ‘c0_11:0’ shape=(None, 64) dtype=float32>]

even though I am following correct steps for defining function:
def music_inference_model(LSTM_cell, densor, Ty=100)

any pointers? I am assuming I am not using the arguments properly for tf.argmax or tf.one_hot or the RepeatVector(1).

It is probably there the issue; the last layers expect 19 inputs, as it says, but it’s getting only 3, the same as the inputs!

Try reading again the steps in Exercise 2 and change your implementation!

The question is how you invoke that function. It might help to see the full exception trace, instead of just the final message. The question is exactly where does that error get thrown.

But even that is probably not enough to give a better clue than “please read the instructions again carefully and compare to your implementation”. If that’s not helpful, then it’s probably time to look at your code. We can’t do that in a public thread of course, but I’ll send you a DM about how to proceed.

Hi Paul, After some trial and error, I was able to figure out, looks like I was initializing to the updated variables, instead of the a0, c0, x0. Once I made the fixes, the model seems to work, although in future I need to understand explicitly what i was doing wrong.

Thank you for offering to help! I am generally in PT too, but these 4 weeks, I am in Indian standard time :slight_smile:

Even though the tests were successful, I barely passed the exam :frowning: 66/100. So, i am still curious to know what I am doing wrong. Just now, I sent a DM with notebook attached to you and please do let me know how I can improve. No rush at all on this, as I passed the exam.