Need help with Course 5 Week 1
Dinosaurus_Island_Character_level_language_model
I’m getting the following Error and Output.
j is 0
idx is 0
number of iterations 22001
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]]
ix newline 0
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]
TypeError Traceback (most recent call last)
in
----> 1 parameters, last_name = model(data.split("\n"), ix_to_char, char_to_ix, 22001, verbose = True)
2
3 assert last_name == ‘Trodonosaurus\n’, “Wrong expected output”
4 print("\033[92mAll tests passed!")
in model(data_x, ix_to_char, char_to_ix, num_iterations, n_a, dino_names, vocab_size, verbose)
88 if j % 2000 == 0:
89
—> 90 print('Iteration: %d, Loss: f' (j, loss) + ‘\n’)
91
92 # The number of dinosaur names to print
TypeError: only size-1 arrays can be converted to Python scalars
Any tips?