I'm facing this error while trying to use tf.image.non_max_suppression while video object detection. Tensorflow version is 1.10.0
ValueError: Shape must be rank 2 but is rank 3 for 'non_max_suppression/NonMaxSuppressionV3' (op: 'NonMaxSuppressionV3') with input shapes: [1,500,4], [1,500], [], [], [].
I get this same error with tensorflow2.1 and the reason is that (as it says in the error) that the batch dimension cannot be there.
Example:
You should remove the first(batch) dimension of the tensors (boxes and scores in the example above) In case your batch dimension is 1 you can use
It seems that you can have batch dimension is in this beast: https://www.tensorflow.org/api_docs/python/tf/image/combined_non_max_suppression