Test code fail

Please add a tag indicating where you are taking the course. Choose only one of the platform options in the tag section then the week/module:

  • coursera-platform
  • dl-ai-learning-platform

My results are the same as expected but test code fails
iou: 0.22780233025311375
scores: [0.855]
boxes: [[0.45 0.2 1.01 2.6 ]]
classes: [0]

AssertionError Traceback (most recent call last)
in
37 scores2, boxes2, classes2 = yolo_non_max_suppression(scores, boxes, [0, 0], iou_threshold = 0.9)
38
—> 39 assert np.allclose(scores2.numpy(), [0.855, 0.828]), f"Wrong value on scores {scores2.numpy()}"
40 assert np.allclose(boxes2.numpy(), [[0.45, 0.2, 1.01, 2.6], [0.42, 0.15, 1.7, 1.01]]), f"Wrong value on boxes {boxes2.numpy()}"
41 assert np.array_equal(classes2.numpy(), [0, 0]), f"Wrong value on classes {classes2.numpy()}"

AssertionError: Wrong value on scores [0.855 0.855]

Expected Output:

iou between boxes: 0.22780233025311375
scores [0.855]
boxes: [[0.45 0.20 1.01 2.60 ]]
classes: [0]

The stacktrace on the assertion shows that expected scores is [0.855, 0.828] but your function generates [0.855 0.855].

So, your implementation is incorrect. That said, if this doesn’t help, please click my name and message your notebook as an attachment.