# W2A1 "Wrong values when training=True."

**URL:** <https://community.deeplearning.ai/t/w2a1-wrong-values-when-training-true/633032>\
**Category:** Convolutional Neural Networks\
**Tags:** week-module-2, coursera-platform\
**Created:** [May 23, 2024, 5:14am UTC](https://community.deeplearning.ai/t/w2a1-wrong-values-when-training-true/633032 "2024-05-23T05:14:54Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![psyquy](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/psyquy/32/68931_2.png) [@psyquy](https://community.deeplearning.ai/u/psyquy)\
**Post date:** [May 23, 2024, 5:14am UTC](https://community.deeplearning.ai/t/w2a1-wrong-values-when-training-true/633032/1 "2024-05-23T05:14:54Z")

</div>

I double, triple check my code, and still getting this error. I set breakpoint and check the shape and value of X an X\_shortcut, everything seem correct to me.

Not sure what else missing

Link to assignment [Residual Networks | Coursera](https://www.coursera.org/learn/convolutional-neural-networks/programming/Oluli/residual-networks)

 ![Screenshot 2024-05-22 at 10.30.09 PM](https://global.discourse-cdn.com/dlai/original/3X/7/9/79a7b51d3d551eb2e9a5cd1fdc3158e9717c7489.png)

---

<div class="post-metadata">

**Author:** ![Nevermnd](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/nevermnd/32/126021_2.png) [@Nevermnd](https://community.deeplearning.ai/u/Nevermnd)\
**Post date:** [May 23, 2024, 5:28am UTC](https://community.deeplearning.ai/t/w2a1-wrong-values-when-training-true/633032/2 "2024-05-23T05:28:40Z")

</div>

@psyquy can you post a screenshot of the errors you are getting ?

---

<div class="post-metadata">

**Author:** ![psyquy](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/psyquy/32/68931_2.png) [@psyquy](https://community.deeplearning.ai/u/psyquy)\
**Post date:** [May 23, 2024, 5:30am UTC](https://community.deeplearning.ai/t/w2a1-wrong-values-when-training-true/633032/3 "2024-05-23T05:30:57Z")

</div>

I update the question with screenshot, please check

---

<div class="post-metadata">

**Author:** ![saifkhanengr](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/saifkhanengr/32/152858_2.png) [@saifkhanengr](https://community.deeplearning.ai/u/saifkhanengr)\
**Post date:** [May 23, 2024, 5:38am UTC](https://community.deeplearning.ai/t/w2a1-wrong-values-when-training-true/633032/4 "2024-05-23T05:38:53Z")

</div>

The most common mistake in this Exercise is to input the `X` for the `SHORTCUT PATH` which is wrong. It shouldn’t be `X`.

---

<div class="post-metadata">

**Author:** ![psyquy](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/psyquy/32/68931_2.png) [@psyquy](https://community.deeplearning.ai/u/psyquy)\
**Post date:** [May 23, 2024, 5:42am UTC](https://community.deeplearning.ai/t/w2a1-wrong-values-when-training-true/633032/5 "2024-05-23T05:42:13Z")

</div>

i did use X\_shortcut for shortcut calculation,

```auto
X_shortcut = X 
...
X_shortcut = <thelayer>()(X_shortcut)
X =Add()([X, X_shortcut])
...
```

---

<div class="post-metadata">

**Author:** ![psyquy](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/psyquy/32/68931_2.png) [@psyquy](https://community.deeplearning.ai/u/psyquy)\
**Post date:** [May 23, 2024, 5:44am UTC](https://community.deeplearning.ai/t/w2a1-wrong-values-when-training-true/633032/6 "2024-05-23T05:44:42Z")

</div>

After restart a few time (without changing any code). now it pass. 🤔

i download to my local machine, and it failed with the same error again

---

<div class="post-metadata">

**Author:** ![saifkhanengr](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/saifkhanengr/32/152858_2.png) [@saifkhanengr](https://community.deeplearning.ai/u/saifkhanengr)\
**Post date:** [May 23, 2024, 5:50am UTC](https://community.deeplearning.ai/t/w2a1-wrong-values-when-training-true/633032/7 "2024-05-23T05:50:59Z")

</div>

Glad to know that…

---

<div class="post-metadata">

**Author:** ![psyquy](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/psyquy/32/68931_2.png) [@psyquy](https://community.deeplearning.ai/u/psyquy)\
**Post date:** [May 23, 2024, 5:58am UTC](https://community.deeplearning.ai/t/w2a1-wrong-values-when-training-true/633032/8 "2024-05-23T05:58:15Z")

</div>

it seems to me that the test suite is not deterministic. report issue to coursera
