So I have a machine learning model which takes in batches of images and corresponding labels. The model should output a prediction for which class (label) it thinks a brand new image its never seen before is. I have a piece of code in my program which shuffles the training images and labels as I manually classified each image. The labels before the shuffling look something like this: [0, 0, 0, 0, 0, 1, 1, 1, 1, 1]
. This is my current code for the shuffling:
permutation = np.random.permutation(len(train_labels))
train_images = train_images[permutation]
train_labels = train_labels[permutation]
The train_images shape looks like this: (192, 7, 36, 64, 1)
The train_labels shape looks like this: (192, 1)
The error and traceback I am getting for the train_labels shuffling:
Traceback (most recent call last):
File "C:/Users/Mason Choi/PycharmProjects/Passion_project/main (test).py", line 43, in <module>
train_labels = train_labels[permutation]
TypeError: only integer scalar arrays can be converted to a scalar index
Process finished with exit code 1