Under GRADED FUNCTION: yolo_filter_boxes I’m getting the following errors
scores[2] = 51
boxes[2] = [[ 1.6324096 -3.0328693 2.9825382 2.0823789 ]
[ 9.22156 -4.6481705 4.59398 4.178326 ]
[ 5.9131794 4.5233383 6.4324903 -0.9242954 ]
[ 2.3059645 -2.6454163 -1.4552906 -2.14476 ]
[-0.0323869 -0.06460571 -0.8356792 1.6121033 ]]
classes[2] = [15 9 3 51 35]
scores.shape = (361,)
boxes.shape = (361, 5, 4)
classes.shape = (361, 5)
AssertionError Traceback (most recent call last)
in
16 assert type(classes) == EagerTensor, “Use tensorflow functions”
17
—> 18 assert scores.shape == (1789,), “Wrong shape in scores”
19 assert boxes.shape == (1789, 4), “Wrong shape in boxes”
20 assert classes.shape == (1789,), “Wrong shape in classes”
AssertionError: Wrong shape in scores
Please any help
Can you please share your code snippet for the corresponding error, so that we can help you debug the code. Please make sure to delete it once your doubt is resolved.
We shouldn’t have to see the source code to help here. Here is the result I get from that test case:
box_scores.shape (19, 19, 5, 80)
box_scores.dtype <dtype: 'float32'>
box_classes.shape (19, 19, 5)
box_classes.dtype <dtype: 'int64'>
box_class_scores.shape (19, 19, 5)
box_class_scores.dtype <dtype: 'float32'>
scores[2] = 9.270486
boxes[2] = [ 4.6399336 3.2303846 4.431282 -2.202031 ]
classes[2] = 8
scores.shape = (1789,)
boxes.shape = (1789, 4)
classes.shape = (1789,)
All tests passed!
So you can see that the correct shape for scores
is (1789,). Well, actually, I guess you can see that from the assertion code in the error traces as well. Notice that your boxes
shape has 3 dimensions and your classes
shape has 2, whereas the correct answers have 2 and 1 respectively. There should be a clue there as to where to look for the error.
Great! Thanks for confirming. Onward! 