While running a Keras model have encountered an error like the below
Solution:
Keras expects y-data in (N, 17) shape, not (N,) as have probably provided, that's why it raises an error.
class_index_one_hot = keras.utils.to_categorical(class_index, 17)
Output Ex: class_index_one_hot: [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 1.]y_train shape: (911, 17) y_test shape: (449, 17)
Reference:
No comments:
Post a Comment