You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
tf.image.combined_non_max_suppression drops detections scoring below -1 and returns equal scores in unspecified order #128926
Have you reproduced the bug with TensorFlow Nightly?
No. Reproduced on the 2.21.0 release wheel. non_max_suppression_op.cc is unchanged between 7b92f54 and master b5d39d2.
Source
binary
TensorFlow version
2.21.0
Custom code
Yes
OS platform and distribution
Windows 11
Python version
3.11.9
Current behavior?
tf.image.combined_non_max_suppression has two problems, both in SelectResultPerBatch / DoNMSPerClass in tensorflow/core/kernels/image/non_max_suppression_op.cc.
The cross-class result vector is prefilled with padding (box_index -1, score -1.0, class -1) and then sorted by score only. A real detection scoring below -1.0 sorts after the padding, so padding takes its place in the top max_total_size.
DoNMSPerClass pops equal scores in std::priority_queue heap order, which is unspecified, so equal-score boxes come back in a different order than tf.image.non_max_suppression returns them (lowest index first).
Hi @teerthsharma, Thank you for reporting this issue!
I see you have already taken the initiative and submitted a PR to fix this issue. Once PR is merged, the issue will be resolved.
Thanks again for your patience and for contributing a fix to TensorFlow!
Activity
Kayyuri commentedon Oct 12, 2026
Hi @teerthsharma, Thank you for reporting this issue!
I see you have already taken the initiative and submitted a PR to fix this issue. Once PR is merged, the issue will be resolved.
Thanks again for your patience and for contributing a fix to TensorFlow!
google-ml-butler commentedon Nov 12, 2026
Are you satisfied with the resolution of your issue?
Yes
No
Make CombinedNonMaxSuppression ordering total