# C4W1-Assignment - Failed Sampling Decode test cases

**URL:** <https://community.deeplearning.ai/t/c4w1-assignment-failed-sampling-decode-test-cases/61724>\
**Category:** NLP with Attention Models\
**Tags:** week-module-1\
**Created:** [November 9, 2021, 2:48am UTC](https://community.deeplearning.ai/t/c4w1-assignment-failed-sampling-decode-test-cases/61724 "2021-11-09T02:48:27Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![sylviasc](https://avatars.discourse-cdn.com/v4/letter/s/c89c15/32.png) [@sylviasc](https://community.deeplearning.ai/u/sylviasc)\
**Post date:** [November 9, 2021, 2:48am UTC](https://community.deeplearning.ai/t/c4w1-assignment-failed-sampling-decode-test-cases/61724/1 "2021-11-09T02:48:27Z")

</div>

Can anyone who can pass this section let me know what’s wrong with my output for sampling decode? Can’t pass any test case.

 ![Screen Shot 2021-11-08 at 9.45.10 PM](https://global.discourse-cdn.com/dlai/original/2X/0/0bb88b2139de74f6f49c3020a3a74b0d428fdc43.png)

---

<div class="post-metadata">

**Author:** ![Mubsi](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/mubsi/32/94983_2.png) [@Mubsi](https://community.deeplearning.ai/u/Mubsi)\
**Post date:** [November 12, 2021, 7:56pm UTC](https://community.deeplearning.ai/t/c4w1-assignment-failed-sampling-decode-test-cases/61724/2 "2021-11-12T19:56:28Z")

</div>

Hi @sylviasc,

Can you share your lab ID with me ? In the assignment, when you click the top right “Help” button, a panel will open and your lab ID will be shown at the bottom.

I shall take a look.

When you reply back, kindly tag me in the post so that I’m notified.

Thanks,  
Mubsi

---

<div class="post-metadata">

**Author:** ![sylviasc](https://avatars.discourse-cdn.com/v4/letter/s/c89c15/32.png) [@sylviasc](https://community.deeplearning.ai/u/sylviasc)\
**Post date:** [November 12, 2021, 8:02pm UTC](https://community.deeplearning.ai/t/c4w1-assignment-failed-sampling-decode-test-cases/61724/3 "2021-11-12T20:02:46Z")

</div>

Hi @Mubsi, thanks for following up. I have solved this issue by reverting to the original parameters about a couple of functions that I thought having way too many parameters (as mentioned in another thread I posted here). I do hope you can look at the last part of my assignment though. I have this “TypeError: iteration over a 0-d array” error couldn’t resolve.

My lab id is cyniiqjq.

Thanks!

---

<div class="post-metadata">

**Author:** ![Mubsi](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/mubsi/32/94983_2.png) [@Mubsi](https://community.deeplearning.ai/u/Mubsi)\
**Post date:** [November 12, 2021, 8:08pm UTC](https://community.deeplearning.ai/t/c4w1-assignment-failed-sampling-decode-test-cases/61724/4 "2021-11-12T20:08:43Z")

</div>

Hi @sylviasc,

I have taken a look at your notebook, and tried fixing some of your mistakes. See if it works now.

Thanks,  
Mubsi

---

<div class="post-metadata">

**Author:** ![sylviasc](https://avatars.discourse-cdn.com/v4/letter/s/c89c15/32.png) [@sylviasc](https://community.deeplearning.ai/u/sylviasc)\
**Post date:** [November 12, 2021, 8:28pm UTC](https://community.deeplearning.ai/t/c4w1-assignment-failed-sampling-decode-test-cases/61724/5 "2021-11-12T20:28:39Z")

</div>

Ahha! Silly me. Thanks!

---

<div class="post-metadata">

**Author:** ![Yingjia\_Liu](https://avatars.discourse-cdn.com/v4/letter/y/d2c977/32.png) [@Yingjia\_Liu](https://community.deeplearning.ai/u/Yingjia_Liu)\
**Post date:** [December 6, 2021, 1:56am UTC](https://community.deeplearning.ai/t/c4w1-assignment-failed-sampling-decode-test-cases/61724/6 "2021-12-06T01:56:02Z")

</div>

Hi @Mubsi ,

I face the same issue as what sylviasc faced, test\_sampling\_decode fail. Could you please help on it?

Thanks,  
YJ

---

<div class="post-metadata">

**Author:** ![Mubsi](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/mubsi/32/94983_2.png) [@Mubsi](https://community.deeplearning.ai/u/Mubsi)\
**Post date:** [December 6, 2021, 2:16pm UTC](https://community.deeplearning.ai/t/c4w1-assignment-failed-sampling-decode-test-cases/61724/7 "2021-12-06T14:16:25Z")

</div>

Hi @Yingjia_Liu,

Can you share your lab ID with me ? In the assignment, when you click the top right “Help” button, a panel will open and your lab ID will be shown at the bottom.

I shall take a look.

When you reply back, kindly tag me in the post so that I’m notified.

Thanks,  
Mubsi

---

<div class="post-metadata">

**Author:** ![Yingjia\_Liu](https://avatars.discourse-cdn.com/v4/letter/y/d2c977/32.png) [@Yingjia\_Liu](https://community.deeplearning.ai/u/Yingjia_Liu)\
**Post date:** [December 9, 2021, 5:18am UTC](https://community.deeplearning.ai/t/c4w1-assignment-failed-sampling-decode-test-cases/61724/8 "2021-12-09T05:18:40Z")

</div>

Hi @Mubsi ,

Thanks for your help, my Lab ID is **gwebaxjm**

Regards,  
YJ

---

<div class="post-metadata">

**Author:** ![Yingjia\_Liu](https://avatars.discourse-cdn.com/v4/letter/y/d2c977/32.png) [@Yingjia\_Liu](https://community.deeplearning.ai/u/Yingjia_Liu)\
**Post date:** [December 20, 2021, 10:21am UTC](https://community.deeplearning.ai/t/c4w1-assignment-failed-sampling-decode-test-cases/61724/9 "2021-12-20T10:21:16Z")

</div>

> [@Yingjia\_Liu](#):
>
> gwebaxjm

Hi @Mubsi ,

May i check any updates for this?

Regards,  
YingJia

---

<div class="post-metadata">

**Author:** ![Mubsi](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/mubsi/32/94983_2.png) [@Mubsi](https://community.deeplearning.ai/u/Mubsi)\
**Post date:** [December 24, 2021, 7:52am UTC](https://community.deeplearning.ai/t/c4w1-assignment-failed-sampling-decode-test-cases/61724/10 "2021-12-24T07:52:18Z")

</div>

Hi @Yingjia_Liu

Do you still need help with this ?

Best,  
Mubsi

---

<div class="post-metadata">

**Author:** ![Yingjia\_Liu](https://avatars.discourse-cdn.com/v4/letter/y/d2c977/32.png) [@Yingjia\_Liu](https://community.deeplearning.ai/u/Yingjia_Liu)\
**Post date:** [December 24, 2021, 8:31am UTC](https://community.deeplearning.ai/t/c4w1-assignment-failed-sampling-decode-test-cases/61724/11 "2021-12-24T08:31:35Z")

</div>

Hi @Mubsi ,

Yes, i still need help.

Thanks,  
YingJia

---

<div class="post-metadata">

**Author:** ![Mubsi](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/mubsi/32/94983_2.png) [@Mubsi](https://community.deeplearning.ai/u/Mubsi)\
**Post date:** [December 27, 2021, 12:53pm UTC](https://community.deeplearning.ai/t/c4w1-assignment-failed-sampling-decode-test-cases/61724/12 "2021-12-27T12:53:51Z")

</div>

Hi @Yingjia_Liu,

I have taken a look till your Ex 7. Let me know if it works now.

Thanks,  
Mubsi

---

<div class="post-metadata">

**Author:** ![Yingjia\_Liu](https://avatars.discourse-cdn.com/v4/letter/y/d2c977/32.png) [@Yingjia\_Liu](https://community.deeplearning.ai/u/Yingjia_Liu)\
**Post date:** [January 1, 2022, 4:54pm UTC](https://community.deeplearning.ai/t/c4w1-assignment-failed-sampling-decode-test-cases/61724/13 "2022-01-01T16:54:43Z")

</div>

Hi @Mubsi ,

Thanks for looking it through, i think the issue is here

w1\_unittest.test\_sampling\_decode(sampling\_decode)  
w1\_unittest.test\_mbr\_decode

these unit test could be passed.

However, i couldn’t find the issue maybe something wrong with my Ex 7 & 10?

Appreciate your help.  
YJ

---

<div class="post-metadata">

**Author:** ![Mubsi](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/mubsi/32/94983_2.png) [@Mubsi](https://community.deeplearning.ai/u/Mubsi)\
**Post date:** [January 3, 2022, 6:34pm UTC](https://community.deeplearning.ai/t/c4w1-assignment-failed-sampling-decode-test-cases/61724/14 "2022-01-03T18:34:20Z")

</div>

Hi @Yingjia_Liu,

I’m going to DM you regarding this.

Thanks,  
Mubsi

---

<div class="post-metadata">

**Author:** ![ivanpoon](https://avatars.discourse-cdn.com/v4/letter/i/47e85d/32.png) [@ivanpoon](https://community.deeplearning.ai/u/ivanpoon)\
**Post date:** [January 8, 2023, 9:59am UTC](https://community.deeplearning.ai/t/c4w1-assignment-failed-sampling-decode-test-cases/61724/15 "2023-01-08T09:59:19Z")

</div>

I have similar issue. I could run UNQ\_C7 in exercise 7. However when I ran test on next cell, the cell won’t stop, ran for 1 hour. And I interrupted it to stop it.

I read many discussons here already.

My Lab ID is: kxbuzbneldgy, Please help!!!

---

<div class="post-metadata">

**Author:** ![Mubsi](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/mubsi/32/94983_2.png) [@Mubsi](https://community.deeplearning.ai/u/Mubsi)\
**Post date:** [January 9, 2023, 4:06pm UTC](https://community.deeplearning.ai/t/c4w1-assignment-failed-sampling-decode-test-cases/61724/16 "2023-01-09T16:06:36Z")

</div>

Hi @ivanpoon,

Your exercise till Ex 7 seems correct a glance. It might be possible that something in the notebook changed which should not have had. I’d recommend to try to get a fresh copy of the notebook and just copy/pst your solutions in it, and try again.

Let me know how it goes.

Best,  
Mubsi

---

<div class="post-metadata">

**Author:** ![ivanpoon](https://avatars.discourse-cdn.com/v4/letter/i/47e85d/32.png) [@ivanpoon](https://community.deeplearning.ai/u/ivanpoon)\
**Post date:** [January 10, 2023, 3:21am UTC](https://community.deeplearning.ai/t/c4w1-assignment-failed-sampling-decode-test-cases/61724/17 "2023-01-10T03:21:04Z")

</div>

After restart from a fresh copy. It works. It seems it is a good Standard Operating Procedure if all checked but still failed, as the grader is not perfect.
