Skip to content

Commit 0ac4cd0

Browse files
authored
Merge pull request #2025 from abigailgold/dev_1.13.1_fix_check_and_transform_label_format
Cast nb_classes to integer in check_and_transform_label_format
2 parents e471a27 + 31209f2 commit 0ac4cd0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

art/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,7 @@ def check_and_transform_label_format(
805805
labels_return = np.expand_dims(labels_return, axis=1)
806806
elif len(labels.shape) == 2 and labels.shape[1] == 1:
807807
if nb_classes is None:
808-
nb_classes = np.max(labels) + 1
808+
nb_classes = int(np.max(labels) + 1)
809809
if nb_classes > 2: # multi-class, index labels
810810
if return_one_hot:
811811
labels_return = to_categorical(labels, nb_classes)

0 commit comments

Comments
 (0)