# NLP C4 Week 2 UNQ\_9 and UNQ\_10

**URL:** <https://community.deeplearning.ai/t/nlp-c4-week-2-unq-9-and-unq-10/156652>\
**Category:** NLP with Attention Models\
**Tags:** week-module-1\
**Created:** [July 7, 2022, 2:26am UTC](https://community.deeplearning.ai/t/nlp-c4-week-2-unq-9-and-unq-10/156652 "2022-07-07T02:26:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheNoob3131](https://avatars.discourse-cdn.com/v4/letter/t/7feea3/32.png) [@TheNoob3131](https://community.deeplearning.ai/u/TheNoob3131)\
**Post date:** [July 7, 2022, 2:26am UTC](https://community.deeplearning.ai/t/nlp-c4-week-2-unq-9-and-unq-10/156652/1 "2022-07-07T02:26:27Z")

</div>

![image](https://global.discourse-cdn.com/dlai/original/3X/f/e/fe34186f859beecc3a5ea25d42d6319efbe4ef66.png)

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.

 ![image](https://global.discourse-cdn.com/dlai/original/3X/d/b/db2d89e6a46192e9e301239525114d1376068836.png)

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.

---

<div class="post-metadata">

**Author:** ![reinoudbosch](https://avatars.discourse-cdn.com/v4/letter/r/22d042/32.png) [@reinoudbosch](https://community.deeplearning.ai/u/reinoudbosch)\
**Post date:** [July 10, 2022, 11:56pm UTC](https://community.deeplearning.ai/t/nlp-c4-week-2-unq-9-and-unq-10/156652/2 "2022-07-10T23:56:54Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![TheNoob3131](https://avatars.discourse-cdn.com/v4/letter/t/7feea3/32.png) [@TheNoob3131](https://community.deeplearning.ai/u/TheNoob3131)\
**Post date:** [July 15, 2022, 8:47pm UTC](https://community.deeplearning.ai/t/nlp-c4-week-2-unq-9-and-unq-10/156652/3 "2022-07-15T20:47:08Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![reinoudbosch](https://avatars.discourse-cdn.com/v4/letter/r/22d042/32.png) [@reinoudbosch](https://community.deeplearning.ai/u/reinoudbosch)\
**Post date:** [July 15, 2022, 10:07pm UTC](https://community.deeplearning.ai/t/nlp-c4-week-2-unq-9-and-unq-10/156652/4 "2022-07-15T22:07:36Z")

</div>

Hi TheNoob3131,

Yes that is ok.

---

<div class="post-metadata">

**Author:** ![TheNoob3131](https://avatars.discourse-cdn.com/v4/letter/t/7feea3/32.png) [@TheNoob3131](https://community.deeplearning.ai/u/TheNoob3131)\
**Post date:** [July 15, 2022, 10:58pm UTC](https://community.deeplearning.ai/t/nlp-c4-week-2-unq-9-and-unq-10/156652/5 "2022-07-15T22:58:37Z")

</div>

Hi reinoudbosch,

Here is the file:  
[C4\_W2\_Assignment.ipynb](https://community.deeplearning.ai/uploads/short-url/xFED8a0xv1gOrcxTTE4ET3eMXrM.ipynb) (110.0 KB)

Thank you so much for your help!

---

<div class="post-metadata">

**Author:** ![reinoudbosch](https://avatars.discourse-cdn.com/v4/letter/r/22d042/32.png) [@reinoudbosch](https://community.deeplearning.ai/u/reinoudbosch)\
**Post date:** [July 16, 2022, 8:36pm UTC](https://community.deeplearning.ai/t/nlp-c4-week-2-unq-9-and-unq-10/156652/6 "2022-07-16T20:36:26Z")

</div>

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:

> [@How to Get a Clean Copy of an Assignment Notebook](https://community.deeplearning.ai/t/how-to-get-a-clean-copy-of-an-assignment-notebook/73):
>
> If you want to restore the original unmodified state of any of the notebooks or the other files associated with any of the assignments, you can use the “Lab Help” menu of Coursera Labs to do that. The first thing to do is to rename the existing notebook, because this procedure will not overwrite existing files. You need to move the current version of the notebook aside or delete it. The advantage of renaming is that you can later copy any completed work as desired to the fresh copy of the noteb…

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.
