Skip to content

Commit

Permalink
Fix for ValueError (expected type INT8) (ultralytics#13341)
Browse files Browse the repository at this point in the history
  • Loading branch information
czy10383 authored and Noobtoss committed Sep 12, 2024
1 parent d30aad0 commit 5946ea0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/YOLOv8-OpenCV-int8-tflite-Python/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,8 @@ def main(self):
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()
Expand Down

0 comments on commit 5946ea0

Please sign in to comment.