Problems with Non-Max-Suppression in Course 4, Week 3, Assignment 1, Exercise 3 (YOLO)

Hello,

I am having trouble with passing the test for Exercise 3 (Non-Max-Suppression) in the YOLO lab of Week 3 in the Convolutional Neural Networks course.

I believe my code is correct insofar as it follows the instructions, but the output does not match the test output. I would kindly ask someone to help me out as it is bottlenecking me currently. I know including code is not allowed but I don’t know who to ask for help with this. Thank you in advance.

{moderator edit - solution code removed}

which gives the error:

“indices[0] = 1 is not in [0, 1) [Op:GatherV2]”,

implying it’s something with the tf.gather() function when defining nms_indices.

Best regards,
Josip.

Yes, that call to tf.gather is incorrect. Think about how it works: you give it two tensors as arguments. The second tensor is index values that are used to select elements from the first tensor. With that in mind, consider how those two tensors that you are passing are defined. It might also be worth comparing to the three later calls to tf.gather which are correct.

Thank you for the quick response, sir.

Changing the code to

{moderator edit - solution code removed}

which, if I am not mistaken, is what would be correct, still returns an error:

“Wrong value on scores [0.828]”.

I’m not sure what the problem is. Do you see it?

The other mistake is that you are just over-riding the overall nms_indices with the partial value that you are computing inside the loop, which is over the labels, right?

You’re supposed to be accumulating them in the loop. The way you wrote it, when you fall out of the loop, all you’ve got is whatever was passed by NMS for the label on the last iteration of the loop. Note that it says to “append” the results of that “gather”.

Thank you very much, it’s working now!

Cheers!

1 Like