NLP C4 Week 2 UNQ_9 and UNQ_10

I’m getting a ‘test failed’ even though all of the previous exercises were all correct (‘All tests passed’). I reran the whole notebook, but it still outputs the same result.

When I try skipping to UNQ_10, it outputs a bunch of random words instead of the expected output.

Is there a problem with my code, or is it another issue? It’s really hard to diagnose the problem since there are so many moving parts and black boxes to consider.

Hi TheNoob3131,

It looks like you are working on an old version of the course which I only remember vaguely and do not have current access to.

Still, from what I see your code for UNQ_C9 looks correct, so the cause may lie with previous exercises. Not everything that could cause an issue is tested by the public tests, so ‘all tests passed’ does not necessarily mean everything is correct.

So I would suggest going through the previous exercises to see if you can spot an error there.

Hi reinoudbosch,

Thanks for the reply! I did go through the previous code multiple times to see what the possible error might be but I wasn’t able to find anything.

Could I download and send you my notebook to help me find the error?

Hi TheNoob3131,

Yes that is ok.

Hi reinoudbosch,

Here is the file:
C4_W2_Assignment.ipynb (110.0 KB)

Thank you so much for your help!

Hi TheNoob3131,

I went through your code and could not find anything wrong. Unfortunately I cannot test your code as I do not have access to the version of the course you are taking.

One thing you could try is to start from a new clean notebook, copy your code in, and see if it passes the tests. This would take care of unintended changes in the code provided in the notebook. To get a clean notebook, follow these suggestions:

Otherwise, I simply would not know. It could have something to do with changes to the stored model parameters. You can in any case submit the notebook and see if you get a high enough score to pass.