I followed the instruction for each step. When I tried the model comparison, I got the error:
AssertionError Traceback (most recent call last)
in
4 # print("%%%%")
5 # print(djmodel_out)
----> 6 comparator(output, djmodel_out)
~/work/W1A3/test_utils.py in comparator(learner, instructor)
16 def comparator(learner, instructor):
17 if len(learner) != len(instructor):
—> 18 raise AssertionError(“Error in test. The lists contain a different number of elements”)
19 for index, a in enumerate(instructor):
20 b = learner[index]
AssertionError: Error in test. The lists contain a different number of elements
And when I print out the model summary, I found my model has 8190 params while the expected params are 45530. I am not sure which part went wrong?
It seems out = densor(x) is not right based on the instruction. But a and c do not have correct dims.
Yes, I initially used
a, _, c = LSTM_cell(inputs=x, initial_state=[a,c])
out = densor(a), but got error like below:
ValueError: Input 0 of layer dense is incompatible with the layer: expected axis -1 of input shape to have value 90 but received input with shape [None, 64], not sure what is wrong here…
That means that you had changed the code to be correct, but had not actually executed the cell that was changed. Just typing new code in a function and then calling the function again runs the old code. You have to actually click “Shift-Enter” on the cell you changed in order for the new code to get interpreted and included in the runtime image. Restarting the kernel and running all cells is an easy way to get things to be consistent again.
What You See is not necessarily What You Get. You can easily demonstrate to yourself how this works.