Hi-
I’m trying to get batch inference running for this EfficientDetLite0 model.
Here is my code and error at the bottom:
import cv2
import glob
import numpy as np
import tflite_runtime.interpreter as tflite
TFLITE_FILENAME = 'models/lite-model_efficientdet_lite0_detection_default_1.tflite'
# -------------- SET INTERPRETER-----------------#
interpreter = tflite.Interpreter(TFLITE_FILENAME)
# ---------------BATCH WORK-----------------------#
input_details = interpreter.get_input_details()
print(input_details)
tensor_index = input_details[0]['index']
interpreter.resize_tensor_input(tensor_index, [4, 320, 320, 3]);
interpreter.allocate_tensors()
#------------------IMAGE READ IN ----------------#
files=glob.glob("images/*.jpg")
images=np.zeros([len(files),320,320,3]).astype(np.uint8)
for i in range(len(files)):
images[i]=cv2.imread(files[i])
images[i]=cv2.cvtColor(images[i],cv2.COLOR_BGR2RGB)
#--------------SET INPUT TENSOR ------------------#
interpreter.set_tensor(tensor_index, images)
#--------------- INVOKE ---------------------#
interpreter.invoke()
-------------------------------------------------------------------------------------------
RuntimeError: /workspace/tensorflow/lite/kernels/detection_postprocess.cc:447 ValidateBoxes(decoded_boxes, num_boxes) was not true.Node number 266 (TFLite_Detection_PostProcess) failed to invoke.
Thanks in advance!