How to continue to train a model with new classes and data?
Best thing to do is to train your network from scratch with the output layers adjusted to the new output class size.
If retraining is an issue, then keep the trained network as it is and only drop the last layer. Add a new layer with the proper output size, initialized to random weights and then fine-tune (train) the entire network.
I have trained a model successfully and now I want to continue training it with new data. If a given data with the same amount of classes it works fine. But having more data then initially it will give me the error:

ValueError: Shapes (?, 14) and (?, 21) are not compatible

How can I dynamically increase the number of classes in my trained model or how to make the model accept a lesser number of classes? Do I need to save the classes in a pickle file?