Skip to content

TF 2.0 tf.image.non_max_suppression always output the length of max_output_size #29628

@xqiangx1991

Description

@xqiangx1991

tensorflow version: tensorflow-2.0.0-beta0

import tensorflow as tf

print(tf.__version__)

bbox = [[0,0,0,0],[0,0,0,0],[0.71619,0.3128575,0.7752377,0.37428612],[0.71619,0.3128575,0.7752377,0.37428612]]
scores = [2.4719129,1.701416,0.89775455,4.354542]

selected_index = tf.image.non_max_suppression(bbox,scores,3000,0.99)

print(selected_index)

and the output is

2.0.0-beta0
tf.Tensor([3 0 0 ... 0 0 0], shape=(3000,), dtype=int32)

I also tried tf.image.non_max_suppression_padded function with parameter pad_to_max_output_size=False and pad_to_max_output_size=True, the output shape is the same

Metadata

Metadata

Assignees

Labels

TF 2.0Issues relating to TensorFlow 2.0comp:opsOPs related issuesstat:awaiting tensorflowerStatus - Awaiting response from tensorflowertype:bugBug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions