From ff4f62adda4dcb715a9e8991abf86f160a5a4a9e Mon Sep 17 00:00:00 2001 From: Sarvagya Malaviya Date: Sun, 30 Oct 2022 12:50:33 +0530 Subject: [PATCH] cast fix #4 --- keras_cv/models/object_detection/yolox/yolox.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keras_cv/models/object_detection/yolox/yolox.py b/keras_cv/models/object_detection/yolox/yolox.py index 34a4308cad..78e9a9e669 100644 --- a/keras_cv/models/object_detection/yolox/yolox.py +++ b/keras_cv/models/object_detection/yolox/yolox.py @@ -643,7 +643,7 @@ def loop_across_batch_2(b, matching_matrix): ) fg_mask_inboxes = tf.reduce_sum(matching_matrix, 0) > 0.0 - num_fg = tf.reduce_sum(fg_mask_inboxes) + num_fg = tf.reduce_sum(tf.cast(fg_mask_inboxes, tf.float32)) fg_mask_indices = tf.reshape(tf.where(fg_mask), [-1]) fg_mask_inboxes_indices = tf.reshape(tf.where(fg_mask_inboxes), [-1, 1])