PLEASE FIX this:
Add: LSTM_cell = LSTM(n_a, return_state = True)
Before:
inference_model = music_inference_model(LSTM_cell, densor, Ty = 50)
I just spent several days on this.
PS. love the courses.
PLEASE FIX this:
Add: LSTM_cell = LSTM(n_a, return_state = True)
Before:
inference_model = music_inference_model(LSTM_cell, densor, Ty = 50)
I just spent several days on this.
PS. love the courses.
Yes I tried for 2 days but this code worked. Thank you @SteveRegis
I agree this exercise was confusing because of too many information into one exercise and having to scroll up and down many times to read the contents. This exercise could have been divided into two parts.
Thank you very much my man 
Thank you for this tip. It really helped as it would have taken a lot of time if I had not seen your post.
It didnt solve my problem
Thanks for your solution. I have the same problem and your answer helped me to solve it. But this is weird to me. In the music_inference_model, I think we should use the trained LSTM_cell from the previous section. However, based on what you suggest and my understanding, we create a new LSTM block that needs to train and use for inference. Can you correct me and explain your idea a little more?
Thanks
That doesnât work for me.
Although it is possible to skip the whole âRestart the Kernel and RUn allâ by just running the code block :
n_values = 90 # number of music values
reshaper = Reshape((1, n_values)) # Used in Step 2.B of djmodel(), below
LSTM_cell = LSTM(n_a, return_state = True) # Used in Step 2.C
densor = Dense(n_values, activation='softmax') # Used in Step 2.D
That is on the beginning on the assignment. This helps save time, but still doesnât solve the main problem with the shape of x
Welcome to the community!
First, please note that youâve replied to a thread that has been cold for three years. Most of the mentors and learners donât stick around long enough to notice youâve added a late reply.
The challenge with most of the assignments in Course 5 is that the LSTM objects are almost always global variables. So after a object is created, if in debugging your code you modify that object, then the internal state of the notebook can become inconsistent, yielding errors that can be extremely difficult to debug.
So the first line-of-defense for that is ârestart the kernel and run all the cells againâ.
If youâre aware of the issues and are willing to use another method, youâre certainly welcome to use it.