TypeError: only integer scalar arrays can be converted to a scalar index

Hi, I want to visualize the image in my data but I’m getting an error

It might have to do with the fact that labels is a list, not an array. Therefore you cannot use array slicing on it. Try to convert labels to an array first:
labels_array = np.array(labels)

Get back to me if it does or doesn’t work.


I also try this one but it won’t work but when I change the label_mode to binary it can visualize the image I don’t know why