you will be surprised by this error in keras

it is just beause you do not make the last layer as Dense(output_dim)

or it will give this error, I’m so upset about this .

model.add(Dense(4, activation=’softmax’))

here 4 is the dim of one hot vector representation of labels.