IndexError: index 5 is out of bounds for axis 1 with size 5 python : I am using a dataset that I created it should have 5 classes and it contain 500 samples for training and 100 samples for testing 
I can't perform this operation 

    Y_train = np_utils.to_categorical(y_train, num_classes)
    Y_test = np_utils.to_categorical(y_test, num_classes)

as it keep give me   

     Y[i, y[i]] = 1.
    IndexError: index 5 is out of bounds for axis 1 with size 5

if I changed the value of classes to 6 it works but this not correct I have 5 classes only 

please I need to help