As Tom says, e.g. maybe you didn’t set X correctly. I “borrowed” the print statement from the “verbose” debug logic later and put that right after my logic to initialize X and Y and here’s what I see:
len(examples) = 1536
X = [None, 20, 21, 18, 9, 1, 19, 1, 21, 18, 21, 19]
Y = [20, 21, 18, 9, 1, 19, 1, 21, 18, 21, 19, 0]
j = 0 idx = 0
single_example = turiasaurus
single_example_chars ['t', 'u', 'r', 'i', 'a', 's', 'a', 'u', 'r', 'u', 's']
single_example_ix [20, 21, 18, 9, 1, 19, 1, 21, 18, 21, 19]
X = [None, 20, 21, 18, 9, 1, 19, 1, 21, 18, 21, 19]
Y = [20, 21, 18, 9, 1, 19, 1, 21, 18, 21, 19, 0]
Iteration: 0, Loss: 23.087336
vocab_size = 27
Nkzxwtdmfqoeyhsqwasjkjvu
vocab_size = 27
Kneb
If that doesn’t shed any light, it might be worth showing us the actual exception trace that you got.