Input Ouput dimensions python keras
Your problem originates in the fact that your testing set consists of examples of just 6 possible classes, while your model is trained with a training set of 9 different labels.

When converting the test set to one-hot-encoding, you need to add the number of possible labels as the 'n_values' parameter. Otherwise by default it relies on the number of classes in the test set (which is 6 in you case).