hello. In car detection with yolo , I encountered this error on Exercise 4 :
ValueError: operands could not be broadcast together with shapes (19,19,5,4) (19,19,5,80)
can anybody help me?
hello. In car detection with yolo , I encountered this error on Exercise 4 :
ValueError: operands could not be broadcast together with shapes (19,19,5,4) (19,19,5,80)
can anybody help me?
Please share your full error. Maybe you are making mistakes in some of the above exercises. Have you passed all the above tests?
I added print statements to my code in that section to show the shapes and types of all the variables. Here’s what I see with correct code in the yolo_filter_boxes
section:
boxes.shape (19, 19, 5, 4)
boxes.dtype <dtype: 'float32'>
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'>
filtering_mask.shape (19, 19, 5)
filtering_mask.dtype <dtype: 'bool'>
sum(filtering_mask) = 1789
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!
Here’s what I see with correct code in the yolo_eval
section:
boxes.shape (19, 19, 5, 4)
boxes.dtype <dtype: 'float32'>
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'>
filtering_mask.shape (19, 19, 5)
filtering_mask.dtype <dtype: 'bool'>
sum(filtering_mask) = 1786
scores[2] = 171.60194
boxes[2] = [-1240.3483 -3212.5881 -645.78 2024.3052]
classes[2] = 16
scores.shape = (10,)
boxes.shape = (10, 4)
classes.shape = (10,)
All tests passed!
Please compare that to what you get with your code and that should give a clue as to where your mistake is.
You could also perform a search and discover that this exact error message has been discussed previously. Maybe start with the ones with a solution accepted mark. Feel free to share what you discover!