Hello again, so I checked it and the error was coming from the size of the input image. So I changed the size to match the input size of the model or in my case 640x640. But now I am facing two new errors one is: Cannot copy from a TensorFlowLite tensor with shape [1, 10, 4] to a Java object with shape [1, 6], which means that my shape(which consists of 6 chess figures) does not match the java code which expects 10, 4 so I find this line in the class: imgData =                     ByteBuffer.allocateDirect(                             4 * DIM_IMG_SIZE_X * DIM_IMG_SIZE_Y * DIM_PIXEL_SIZE); and I delete the 4 so this error dissapears, but new one appears:  java.nio.BufferOverflowException. I apply my interpreter class now, please help me I really am in a pickle: https://pastebin.com/Hti2zeJm. This exception appears at line 189. Thanks in advance.