Number of units in the final dense layer in a multi-class classification problem should equal to the number of classes. This number is not 3 for this assignment.
Loss function should be categorical_crossentropy
for a multiclass classification problem only if output classes are one-hot encoded. If not, use the loss function where the classes are represented as integers.