C4_W1_Q6 Output close to expected output but wrong

I’m stuck here for a few hours. No matter what I do, the output is still a few digits different from the expected output. What is wrong here, please help. I attached the error message below


AssertionError Traceback (most recent call last)
in
1 # UNIT TEST
2 # test_next_symbol
----> 3 w1_unittest.test_next_symbol(next_symbol, NMTAttn)

~/work/w1_unittest.py in test_next_symbol(target, model)
557 next_de_tokens = target(the_model, tokens_en, [18477], 0.0)
558 # print(‘next_de_tokens’, next_de_tokens)
→ 559 assert np.allclose([next_de_tokens[0], next_de_tokens[1]], [7283, -9.929085731506348]), f"Expected output: [{7283}, {-9.929085731506348}], your output: [{next_de_tokens[0]}, {next_de_tokens[1]}]"
560
561 print(“\033[92m All tests passed”)

AssertionError: Expected output: [7283, -9.929085731506348], your output: [7283, -9.819931983947754]

Hi @Frank_wu1

Most common mistake is using global variable model instead of the passed parameter NMTAttn.

Could that be your problem?

No, it was not my problem.

You can private message me (by clicking on my nickname) with your notebook attached and I can try to help.

Hi @arvyzukai , I get a similar situation, the output is slight different as below:
AssertionError: Expected output: [7283, -9.929085731506348], your output: [7283, -9.864036560058594]… I just message you with my lap ID. Many thanks as well.

Hi @EdmondChan

Mentors cannot access your learners’ notebooks by IDs (only staff members can). Before you private message me your notebook, please check these cases.