# C1\_W3\_Assignment # UNQ\_C1: error - wrong shape wrong output

**URL:** <https://community.deeplearning.ai/t/c1-w3-assignment-unq-c1-error-wrong-shape-wrong-output/144445>\
**Category:** AI for Medical Diagnosis\
**Tags:** week-module-3\
**Created:** [June 21, 2022, 7:58pm UTC](https://community.deeplearning.ai/t/c1-w3-assignment-unq-c1-error-wrong-shape-wrong-output/144445 "2022-06-21T19:58:15Z")\
**Posts on this page:** 10\
**Page:** 2

<div class="post-metadata">

**Author:** ![getjaidev](https://avatars.discourse-cdn.com/v4/letter/g/a3d4f5/32.png) [@getjaidev](https://community.deeplearning.ai/u/getjaidev)\
**Post date:** [May 4, 2023, 5:32am UTC](https://community.deeplearning.ai/t/c1-w3-assignment-unq-c1-error-wrong-shape-wrong-output/144445/21 "2023-05-04T05:32:46Z")

</div>

Hi @Kietsakul

Welcome to the community. Note sure if this was answered earlier.

You might have missed this.

![372670857fff9de1336abe9dba5801b2309bbf39](https://global.discourse-cdn.com/dlai/original/3X/2/7/27bf73d2689799fd16bee4ea170e4aa67a462b23.png)

You may not have included number of classes.

Cheers,  
Jaidev

---

<div class="post-metadata">

**Author:** ![SSC13](https://avatars.discourse-cdn.com/v4/letter/s/8baadc/32.png) [@SSC13](https://community.deeplearning.ai/u/SSC13)\
**Post date:** [May 4, 2023, 1:16pm UTC](https://community.deeplearning.ai/t/c1-w3-assignment-unq-c1-error-wrong-shape-wrong-output/144445/22 "2023-05-04T13:16:42Z")

</div>

Thanks, actually I did:  
y = to\_categorical(y, num\_classes=num\_classes)  
Nonetheless, it just passed the tests last night. I still can’t figure out what happened earlier. HaHa.

---

<div class="post-metadata">

**Author:** ![getjaidev](https://avatars.discourse-cdn.com/v4/letter/g/a3d4f5/32.png) [@getjaidev](https://community.deeplearning.ai/u/getjaidev)\
**Post date:** [May 5, 2023, 12:15pm UTC](https://community.deeplearning.ai/t/c1-w3-assignment-unq-c1-error-wrong-shape-wrong-output/144445/23 "2023-05-05T12:15:57Z")

</div>

So you are one-hot encoding there.

But, glad it worked out. Thanks for letting us know @SSC13

Best.

– Jaidev

---

<div class="post-metadata">

**Author:** ![Mikolay\_Kostiuk](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@Mikolay\_Kostiuk](https://community.deeplearning.ai/u/Mikolay_Kostiuk)\
**Post date:** [August 16, 2023, 11:24am UTC](https://community.deeplearning.ai/t/c1-w3-assignment-unq-c1-error-wrong-shape-wrong-output/144445/24 "2023-08-16T11:24:58Z")

</div>

I have same problem/  
Lab id is axtkpbbuskay  
Test one\_hot\_encodind see to me all correct.  
Can you help me

---

<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:** [August 17, 2023, 7:47am UTC](https://community.deeplearning.ai/t/c1-w3-assignment-unq-c1-error-wrong-shape-wrong-output/144445/25 "2023-08-17T07:47:26Z")

</div>

Hi @Mikolay_Kostiuk,

You are not correctly changing the dimension of x and y.

Best,  
Mubsi

---

<div class="post-metadata">

**Author:** ![Mikolay\_Kostiuk](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@Mikolay\_Kostiuk](https://community.deeplearning.ai/u/Mikolay_Kostiuk)\
**Post date:** [August 17, 2023, 10:53am UTC](https://community.deeplearning.ai/t/c1-w3-assignment-unq-c1-error-wrong-shape-wrong-output/144445/26 "2023-08-17T10:53:20Z")

</div>

Many thanks

---

<div class="post-metadata">

**Author:** ![horatius83](https://avatars.discourse-cdn.com/v4/letter/h/6f9a4e/32.png) [@horatius83](https://community.deeplearning.ai/u/horatius83)\
**Post date:** [June 21, 2025, 3:28pm UTC](https://community.deeplearning.ai/t/c1-w3-assignment-unq-c1-error-wrong-shape-wrong-output/144445/27 "2025-06-21T15:28:36Z")

</div>

Hello,  
I’m getting the error:

```auto
Error: Wrong output. for variable in position 0.
Error: Wrong output. for variable in position 1.
...
 2 Tests passed
 1 Tests failed

```

I’m setting the number of classes correctly (I believe), and I can’t think of how the offsets for start\_x etc. should work other than how I have them. My lab id is njuhsuivlxsq , any help is greatly appreciated.

Thanks,  
Max

---

<div class="post-metadata">

**Author:** ![Deepti\_Prasad](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/deepti_prasad/32/165831_2.png) [@Deepti\_Prasad](https://community.deeplearning.ai/u/Deepti_Prasad)\
**Post date:** [June 21, 2025, 6:12pm UTC](https://community.deeplearning.ai/t/c1-w3-assignment-unq-c1-error-wrong-shape-wrong-output/144445/28 "2025-06-21T18:12:33Z")

</div>

try to create a new topic rather posting older threads, is this your complete error? please make sure not to post any grade function codes

---

<div class="post-metadata">

**Author:** ![Jfgirald](https://avatars.discourse-cdn.com/v4/letter/j/2bfe46/32.png) [@Jfgirald](https://community.deeplearning.ai/u/Jfgirald)\
**Post date:** [July 10, 2025, 1:57pm UTC](https://community.deeplearning.ai/t/c1-w3-assignment-unq-c1-error-wrong-shape-wrong-output/144445/29 "2025-07-10T13:57:31Z")

</div>

Hi.

Having the same issue. I think the one hot coding is ok, but having wrong answer.

My notebook code is fahtlhoexrdm.

Thanks in advance

---

<div class="post-metadata">

**Author:** ![Deepti\_Prasad](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/deepti_prasad/32/165831_2.png) [@Deepti\_Prasad](https://community.deeplearning.ai/u/Deepti_Prasad)\
**Post date:** [July 10, 2025, 2:28pm UTC](https://community.deeplearning.ai/t/c1-w3-assignment-unq-c1-error-wrong-shape-wrong-output/144445/30 "2025-07-10T14:28:49Z")

</div>

hi @Jfgirald

This isn’t the way it works. mentors don’t have access to your notebook or id. You are always suppose to create a new topic with brief explanation and screenshot(s) of error or mismatch output without posting any grade function codes is the first step to get help. have similar error doesn’t always mean same issues with older Post creator.

So kindly do the needful, so mentors can further guide you.(Post screenshot of your error, exercise you encountered issue.

[Previous page](https://community.deeplearning.ai/t/c1-w3-assignment-unq-c1-error-wrong-shape-wrong-output/144445.md?page=1)
