Course 4 week 3 Exercise 4 - yolo_eval

hello sir I can’t find the issue, who can give me any support?

{moderator edit - solution code removed}

I sovle it !!!!!!oh my god


That’s great to hear. Thanks for confirming.

For anyone else who runs into this kind of trouble on this exercise, note that you can’t just port forward your solutions from this exercise in the previous course with no changes. They changed the function definition of yolo_filter_boxes, so you need to modify your code accordingly. There was at least one other change as well, so compare everything carefully and don’t just assume you can simply “copy/paste” and be done with it.

1 Like

thank you sir , I will pay attention to the details

I have run into the same trouble, but don’t know what is wrong here. Code is below:

{moderator edit - solution code removed}

I am getting this error -
InvalidArgumentError: Incompatible shapes: [19,19,5,4] vs. [19,19,5,80] [Op:Mul]

Could you please help me out?

1 Like

Did you read my previous post on this thread? Here’s the relevant quote:

Here is the definition of the function yolo_filter_boxes from the current version of the notebook:

def yolo_filter_boxes(boxes, box_confidence, box_class_probs, threshold = .6):

And here is the definition from the old (pre-April 2021) version of this assignment:

def yolo_filter_boxes(box_confidence, boxes, box_class_probs, threshold = .6):

See the difference? Your code uses the old definition, but you’re calling the new function. As you can see by comparing the definitions, that will not end well.

Hey - i think i run into another issue.

i get this error:

and for the unit test:

and i dont know what is wrong.

Would be glad if you could help.

My code snippet:

{moderator edit - solution code removed}

Thank you

The error message seems pretty clear, doesn’t it? It’s telling you that the return statement shown there is not part of the function. And that also explains why the return value from your yolo_eval function is “None”, which is what the second error is telling you. The first rule of debugging is that you need to believe what the error message is telling you. If you don’t understand what it says, that is probably part of your problem and it’s the first thing you need to address.

My guess is that you probably modified the indentation of some lines in the template code so that the return statement they gave you no longer looks like part of the function. Indentation is part of the syntax of python, right? You can’t just randomly mess with it. That’s where I suggest you look.