But why its happing ? why TFLite doesn’t support calling like below?
interpreter = tf.lite.Interpreter(model_path="quant_model.tflite")
interpreter.allocate_tensors()

input_details = interpreter.get_input_details()
output_details = interpreter.get_output_details()

def generate_frames(frame):

    image= cv2.resize(frame,(256,256))
    image= cv2.cvtColor(image, cv2.COLOR_BGR2RGBA)

    #converting into float32
    image= (image/255.0).astype(np.float32)

    #prediction
    image= run_inference(np.expand_dims(image[:,:,:3], axis=0)) # <<< problem happens here

            
    final_result = (image*255).astype(np.uint8)
            
    ret,buffer=cv2.imencode('.jpg',final_result)

    frame=buffer.tobytes()

    return frame



def run_inference(image):
    # perform inference and parse the outputs
    interpreter.set_tensor(input_details[0]['index'], image)
    interpreter.invoke()
    outputs = interpreter.get_tensor(output_details[0]['index'])[0]
    return outputs