When I used Keras.max(box_scores,keep_dims=False) in an assignment, I got an error, and it was "mask cannot be scalar". But when I used Keras.max(box_scores,axis=-1,keep_dims=False) , I got the result. But I don't understand it.What is the purpose of axis=-1 in this function to correct this error?
box_scores = box_confidence * box_class_probs
box_classes = K.argmax(box_scores, axis=-1)
box_class_scores = K.max(box_scores,keepdims=False)
filtering_mask = ((box_class_scores)>=threshold)
scores = tf.boolean_mask(box_class_scores,filtering_mask ,name="filtering_scores")
boxes = tf.boolean_mask(boxes,filtering_mask ,name="filtering_boxes")
classes = tf.boolean_mask(box_classes,filtering_mask ,name="filtering_classes")
Here, box_confidence = tensor of shape (19, 19, 5, 1), boxes -- tensor of shape (19, 19, 5, 4), box_class_probs -- tensor of shape (19, 19, 5, 80), and threshold -- real value, if [ highest class probability score < threshold], then get rid of the corresponding box.
