C5-W1-A3 Ex1 Improvise Jazz Solo with LSTM [Can't compile the student's code. Error: AssertionError('Error in test')]

Hi all,

At my wits’ end with this exercise, so I’m hoping to get some help here. So for the first exercise djmodel, I’ve seen a lot of related threads where it mentions for step 2A to slice as x = X[:,t,:] which I have already done so but I run into the assertion error as follows. I’ve looked into my model summary and eventually there is a Reshape layer but not before it has 30
TensorFlowOpLayers above. I’m not sure what the issue is here since my model runs fine for the most part. (The total params from model matches the expected 45,530).

Appreciate any pointers!

Sorry not sure how to properly resolve this thread. But I found the issue a while after posting this. It was because the LSTM_cell in 2C was not properly initialized for subsequent time steps. Instead of using previous step’s hidden state and cell state, I was using the initial (0th step) hidden state and cell state, leading to this.

It’s great that you were able to find the solution with your own analysis. Congrats and thanks for letting us know it is solved! That’s enough to resolve the thread. Onward! :nerd_face: