# find the number of classes in Cifar-10 dataset

I am trying to find the number of classes in Cifar-10 dataset, but it gives me the error below:

TypeError: unhashable type: 'numpy.ndarray'

cifar10 = tf.keras.datasets.cifar1
(x_train, y_train), (x_test, y_test) = cifar10.load_data()
print(x_train.shape, y_train.shape, x_test.shape, y_test.shape)
# number of classes
import numpy as np
from numpy import array

K = len(set(y_train))

# calculate total number of classes

print("number of classes:", K)

• Try converting the numpy array to a list using the tolist method before converting it to a set. Apr 19 at 7:43

#number of classes