Custom transfer learning tensorflowlite model gives error in android code for image classification

Hello, I am trying to create chess pieces image classification program running on my phone. I trained my model using transfer learning technique. Made 6 classes for the six figures and converted my tf model to tflite model. When I use the model with a labelmap in the android project I get an error stating: Caused by: java.lang.IllegalArgumentException: Label number 6 mismatch the shape on axis 1.

The whole error log is here: .
This is my tflite model:
This is my label map:
This is my image classifier code:
This is my main activity code:

Because I followed a tutorial for the image classification in android I saw that the guy uses another model, so I tried the code with his model and it is running okay, the error comes only with my model.
Can this be due to different training image size of my model and the camera making different size picture?