Error in :Jazz improvisation with LSTM

That’s good news! If the “Kernel → Restart” trick works, that means that you had run some of the cells multiple times or in the wrong order. In a lot of the assignments in DLS C5, there are “stateful” global objects that get created (e.g. LSTM_cell in this instance) and executing some of the cells changes the state of the global objects. So it doesn’t always work if you run the test cell multiple times without running everything from scratch. Here’s a recent reply from Tom about a similar situation that explains this in more detail.