Skip to content

Commit

Permalink
Fix dtype of tf argmax
Browse files Browse the repository at this point in the history
  • Loading branch information
fchollet committed Nov 30, 2024
1 parent f529d62 commit 7943660
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion keras/src/trainers/data_adapters/tf_dataset_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def class_weights_map_fn(*data):
if y.shape.rank >= 2:
y_classes = tf.__internal__.smart_cond.smart_cond(
tf.shape(y)[-1] > 1,
lambda: tf.argmax(y, axis=-1),
lambda: tf.argmax(y, axis=-1, output_type=tf.int32),
lambda: tf.cast(tf.round(tf.squeeze(y, axis=-1)), tf.int32),
)
else:
Expand Down

0 comments on commit 7943660

Please sign in to comment.