ranking icon indicating copy to clipboard operation
ranking copied to clipboard

is_label_valid in utils.py lacks support for integer targets

Open nmonette opened this issue 3 years ago • 0 comments

Hello. in function is_label_valid (line 76 of utils.py), the following code is given:

def is_label_valid(labels):
  """Returns a boolean `Tensor` for label validity."""
  labels = tf.convert_to_tensor(value=labels)
  return tf.greater_equal(labels, 0.)

The result of this is an error if the target is an integer, because 0. is a float, and tf.greater_equal expects a both arguments to be of the same type. This prevents support for targets/labels that are integers.

nmonette avatar Jan 01 '23 01:01 nmonette