DLS C5W1A2 Grade Issue - KeyError('da_next')

Assigment Link: https://www.coursera.org/learn/nlp-sequence-models/programming/NaIA5/dinosaur-island-character-level-language-modeling

Description: I submitted the assignment after passing all test cases. I received 75/100, upon checking grader output showed following:

Code Cell UNQ_C1: Function 'clip' is correct.
Code Cell UNQ_C2: Function 'sample' is correct.
Code Cell UNQ_C3: Unexpected error (KeyError('da_next')) occurred during function check. We expected function `optimize` to return Test 3 failed. Please check that this function is defined properly.
Code Cell UNQ_C4: Function 'model' is correct.

I further looked at the code and found out ‘utils.py’ at line 199 creates it and access it in some other locations in same file.

The code also runs fine on my local setup but last word generated on my local is same (‘Trocephods’) in each run BUT different than what test case expects (‘Trodonosaurus’) though the same code in online environment generate correct one.

I do not understand the error.

Can someone help out?

If you’ve:

  1. Completed all the exercises
  2. Not used global variables unless required
  3. Refreshed your workspace and ensured that the notebook isn’t corrupt

and this doesn’t help

then, please click my name and message your notebook as an attachment.

1 Like

Found my answer here.

1 Like