C5W1A2 Exercise 4 Training Model - sampling stops working after ~850th iteration

The model generates only one new line character after ~850th iteration. But the loss continue to decrease to 0.044203.

This is the last iteration output:

Iteration: 22000, Loss: 0.044203

[0]

[0]

[0]

[0]

[0]

[0]

[0]

Can someone help me please?

Does your “sample()” function pass all its tests?

The main problem is that the seven dino names you’re supposed to print are only showing the character index 0.

So it’s possible that your code has wiped-out the char_to_ix dictionary.

This has been resolved. The problem was a bug in my code for setting Y. I accidently added a new line character (its index) at the front of Y, causing the model to sample 0 in the beginning.

Thanks for your help!