Fix for ValueError (expected type INT8) (#13341)

This commit is contained in:
czy10383 2024-06-04 18:23:18 +08:00 committed by GitHub
parent 5df2d167a9
commit cf081c4db7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -258,7 +258,8 @@ class Yolov8TFLite:
img_data = img_data.transpose((0, 2, 3, 1))
scale, zero_point = input_details[0]["quantization"]
interpreter.set_tensor(input_details[0]["index"], img_data)
img_data_int8 = (img_data / scale + zero_point).astype(np.int8)
interpreter.set_tensor(input_details[0]["index"], img_data_int8)
# Run inference
interpreter.invoke()