# Stuck on yolo\_eval function

**URL:** <https://community.deeplearning.ai/t/stuck-on-yolo-eval-function/299334>\
**Category:** Convolutional Neural Networks\
**Tags:** coursera-platform\
**Created:** [March 30, 2023, 2:22am UTC](https://community.deeplearning.ai/t/stuck-on-yolo-eval-function/299334 "2023-03-30T02:22:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Edgar\_S\_Gilchrist\_Jr](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/edgar_s_gilchrist_jr/32/33899_2.png) [@Edgar\_S\_Gilchrist\_Jr](https://community.deeplearning.ai/u/Edgar_S_Gilchrist_Jr)\
**Post date:** [March 30, 2023, 2:22am UTC](https://community.deeplearning.ai/t/stuck-on-yolo-eval-function/299334/1 "2023-03-30T02:22:41Z")

</div>

I get the error

```auto
ValueError: operands could not be broadcast together with shapes (19,19,5,4) (19,19,5,80)

```

I’m not sure whether it’s ok to post my code here, so I won’t, but I can, if that would help.

Anyway, I think the culprit is that first shape. I think it’s supposed to be (19,19,5,1) . It corresponds to box\_confidence. But I checked the shape of that and it IS (19,19,5,1)

---

<div class="post-metadata">

**Author:** ![TMosh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/tmosh/32/9321_2.png) [@TMosh](https://community.deeplearning.ai/u/TMosh)\
**Post date:** [March 30, 2023, 5:52am UTC](https://community.deeplearning.ai/t/stuck-on-yolo-eval-function/299334/2 "2023-03-30T05:52:13Z")

</div>

Posting your code isn’t allowed. However, if a mentor needs to see your code, we’ll ask you to download your notebook and send it via a private message.

Please post a screen capture image that shows the entire assert stack and any error messages. This will help me know what you were attempting to do when the error happened (just running the notebook, vs. submitting it for grading).

---

<div class="post-metadata">

**Author:** ![ai\_curious](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/ai_curious/32/128003_2.png) [@ai\_curious](https://community.deeplearning.ai/u/ai_curious)\
**Post date:** [March 30, 2023, 11:15am UTC](https://community.deeplearning.ai/t/stuck-on-yolo-eval-function/299334/4 "2023-03-30T11:15:04Z")

</div>

Recall that the recipe for output shape of this exercise’s YOLO v2 model is S\*S\*B\*(1+4+C) where S=19, B=5 and C=80. The _4_ is bounding box values for location and shape. The error message suggests you are trying to multiply box coordinates times class confidence, which, as your intuition correctly suggests, does not make mathematical or operational sense. Take a close look at the variables and make sure you’re not using the wrong _box…_ variable.

You should also pay close attention to the order in which parameters are passed to _yolo\_filter\_boxes()_

---

<div class="post-metadata">

**Author:** ![Edgar\_S\_Gilchrist\_Jr](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/edgar_s_gilchrist_jr/32/33899_2.png) [@Edgar\_S\_Gilchrist\_Jr](https://community.deeplearning.ai/u/Edgar_S_Gilchrist_Jr)\
**Post date:** [March 30, 2023, 11:25am UTC](https://community.deeplearning.ai/t/stuck-on-yolo-eval-function/299334/5 "2023-03-30T11:25:41Z")

</div>

![Screen Shot 2023-03-30 at 7.24.30 AM](https://global.discourse-cdn.com/dlai/original/3X/8/a/8a56a47353655ee5b5166a41eb7b135b5389c61c.png)

---

<div class="post-metadata">

**Author:** ![Edgar\_S\_Gilchrist\_Jr](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/edgar_s_gilchrist_jr/32/33899_2.png) [@Edgar\_S\_Gilchrist\_Jr](https://community.deeplearning.ai/u/Edgar_S_Gilchrist_Jr)\
**Post date:** [March 30, 2023, 11:33am UTC](https://community.deeplearning.ai/t/stuck-on-yolo-eval-function/299334/6 "2023-03-30T11:33:22Z")

</div>

Thanks to both of you for your speedy responses. @ai_curious , you are absolutely right. I had the order of arguments mixed up to yolo\_filter\_boxes()
