Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tflite_example.py error when running inferences #12

Open
SirTapir opened this issue Jun 5, 2020 · 0 comments
Open

tflite_example.py error when running inferences #12

SirTapir opened this issue Jun 5, 2020 · 0 comments

Comments

@SirTapir
Copy link

SirTapir commented Jun 5, 2020

Hello, I tried to run tflite_example.py on multiple different images.
Some runs smoothly, other crashed with different error code. The images can be found here

scream.jpg

Traceback (most recent call last):
  File "tflite_example.py", line 160, in <module>
    draw_boxes(boxes, classes, scores, img, class_names, (height, width), True)
  File "tflite_example.py", line 106, in draw_boxes
    for box, score, cls in zip(boxes, scores, classes):
TypeError: zip argument #1 must support iteration

girl.png

Traceback (most recent call last):
  File "tflite_example.py", line 153, in <module>
    interpreter.set_tensor(input_details[0]['index'], np.expand_dims(img_resized, 0))
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/lite/python/interpreter.py", line 197, in set_tensor
    self._interpreter.SetTensor(tensor_index, value)
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/lite/python/interpreter_wrapper/tensorflow_wrap_interpreter_wrapper.py", line 136, in SetTensor
    return _tensorflow_wrap_interpreter_wrapper.InterpreterWrapper_SetTensor(self, i, value)
ValueError: Cannot set tensor: Dimension mismatch. Got 4 but expected 3 for dimension 3 of input 103.

kite.jpg and person.jpg runs fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant