Please see this thread.
The problem is LSTM_cell is defined as a global variable, and is easily broken during debugging. So, you need to reset LSTM_cell like this if there is an error.
LSTM_cell = LSTM(n_a, return_state = True)
Of course, this resets trained weights as well. So, once you fix an error, it is better to re-run all cells.
But, do not need to restart kernel everytime for debugging.