I want to use tensorflow tf.image.non_max_suppression function.
I tried both snippets below:
indices = tf.image.non_max_suppression(
boxes=anchors_fit,
scores=rpn_cls_prob,
max_output_size=self.max_outputs_num,
)
indices,scores = tf.image.non_max_suppression_with_scores(
boxes=anchors_fit,
scores=rpn_cls_prob,
max_output_size=self.max_outputs_num,
)
where anchors_fit.shape
is [36864,4]
and rpn_cls_prob.shape
is [36864]
Both calls raise:
ValueError: Shape must be rank 0 but is rank 1 for 'non_max_suppression_with_scores/NonMaxSuppressionV5' (op: 'NonMaxSuppressionV5') with input shapes: [36864,4], [36864], [1], [], [], [].
What should i do?