google-coral / tflite

Examples using TensorFlow Lite API to run inference on Coral devices
https://coral.withgoogle.com
Apache License 2.0
182 stars 68 forks source link

Unsupported data type in custom op handler: 0Node number 1, libedgetpu-dev 15.0 #45

Closed zdavatz closed 3 years ago

zdavatz commented 3 years ago

dpkg -l | grep edgetpu shows me:

ii  edgetpudemo                          3-1                                 all          Edge TPU demo script
ii  libedgetpu-dev                       15.0                                arm64        Development files for libedgetpu
rc  libedgetpu1-max:arm64                15.0                                arm64        Support library for Edge TPU
ii  libedgetpu1-std:arm64                15.0                                arm64        Support library for Edge TPU
ii  python3-edgetpuvision                7-1                                 arm64        EdgeTPU camera API

but when I run python3 examples/classify_image.py --model test_data/mobilenet_v2_1.0_224_inat_bird_quant_edgetpu.tflite --labels test_data/inat_bird_labels.txt --input test_data/parrot.jpg I still get:

Traceback (most recent call last):
  File "examples/classify_image.py", line 84, in <module>
    main()
  File "examples/classify_image.py", line 62, in main
    interpreter.allocate_tensors()
  File "/home/mendel/.local/lib/python3.7/site-packages/tflite_runtime/interpreter.py", line 242, in allocate_tensors
    return self._interpreter.AllocateTensors()
  File "/home/mendel/.local/lib/python3.7/site-packages/tflite_runtime/interpreter_wrapper.py", line 115, in AllocateTensors
    return _interpreter_wrapper.InterpreterWrapper_AllocateTensors(self)
RuntimeError: Internal: Unsupported data type in custom op handler: 0Node number 1 (EdgeTpuDelegateForCustomOp) failed to prepare.

any hints or thoughts?

zdavatz commented 3 years ago

Ok, I solved this. I had to many old tflite_runtime installed. First I removed all versions that I had installed using pip install --user and sudo pip install. Then I installed version 2.5.0 using apt-get sudo apt-get install python3-tflite-runtime.

This helped:

  1. pip3 uninstall tflite_runtime
  2. sudo pip3 uninstall tflite_runtime