I am getting a “AssertionError: Wrong values in translation” in Exercise 8
Here’s my output
AssertionError Traceback (most recent call last)
<ipython-input-33-a562b46d78e0> in <module>
1 # UNIT TEST
----> 2 Transformer_test(Transformer, create_look_ahead_mask, create_padding_mask)
~/work/W4A1/public_tests.py in Transformer_test(target, create_look_ahead_mask, create_padding_mask)
286 assert np.allclose(translation[0, 0, 0:8],
287 [0.017416516, 0.030932948, 0.024302809, 0.01997807,
--> 288 0.014861834, 0.034384135, 0.054789476, 0.032087505]), "Wrong values in translation"
289
290 keys = list(weights.keys())
AssertionError: Wrong values in translation
I guess the test is trying to compare the first few elements of my output to the expected values and failing.
I have passed the tests for all other exercises.
Please help.
TMosh
May 31, 2023, 5:58pm
2
An quick search of the forum for the term “wrong values in translation” will turn up a lot of threads on this:
For example:
All the tests have passed up to Exercise 8 - Transformer. I get an Assertion Error for the translation and I can’t figure out why. For the final_output I only use 1 line of code even though the comment says to use 2 lines. Any ideas where I could be making a mistake? Thanks.
AssertionError Traceback (most recent call last)
in
1 # UNIT TEST
----> 2 Transformer_test(Transformer, create_look_ahead_mask, create_padding_mask)
~/work/W4A1/public_tests.py in Transform…
hwdc
November 5, 2023, 2:45pm
3
Encounter exactly the same error; can’t figure out where goes wrong, need some support…
Checked last linear layer setup, dense with target vocab size, input sentence with encoder, output sentence with decoder…
If I recall correctly, the error was on one of the previous exercises and not on UNQ_C8. Though I had passed the test cases for that exercise, there was a mistake in that exercise which is causing this exercise to fail. Hope this helps.