I had this same error. I found that recompiling the LSTM and retraining, then changing the one_hot function to have no other inputs than ‘indices’ and ‘depth’ will solve the problem:

tf.one_hot( indices, depth)

This error starts with running the below cell:

“### YOU CANNOT EDIT THIS CELL

inference_model = music_inference_model(LSTM_cell, densor, Ty = 50)”

The initial error is:

“Input ‘b’ of ‘MatMul’ Op has type float32 that does not match type int32 of argument ‘a’”

This occurs if you set your function:

one_hot(indices, depth, on_value = 1 and off_value = 0)

because these values are dtype = ‘int32’

After which, the error, interestingly becomes:

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

The number of inputs LSTM expects increases by 2 every time you run the cell. So, you input 3 tensors, but initially LSTM expects 5, then 7… etc.

I am not sure why this is but based on the fact that LSTM must be recompiled to work after the edits, I assume that the function is being appended after two iterations every time it is run. So the ‘for loop’ adds a required input after initialization and then another when the error occurs. I don’t understand the internals enough to know why.