tflite: EdgeTpuDelegateForCustomOp failed to prepare

When following the guide at https://coral.ai/docs/dev-board/get-started#6-run-a-model-using-the-tensorflow-lite-api I see the following error instead of the expected classification results:

mendel@red-bunny:~/tflite/python/examples/classification$ python3 classify_image.py \
> --model models/mobilenet_v2_1.0_224_inat_bird_quant_edgetpu.tflite \
> --labels models/inat_bird_labels.txt \
> --input images/parrot.jpg
Traceback (most recent call last):
  File "classify_image.py", line 122, in <module>
    main()
  File "classify_image.py", line 100, 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: 0Node number 1 (EdgeTpuDelegateForCustomOp) failed to prepare.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 23

Most upvoted comments

Awesome, thanks, that works! Closing.

@petewarden So the issue is that you got mismatching version of libedgetpu1-std:arm64 and tflite_runtime. The fix for this should be as easy as an apt update and reinstall your package:

$ sudo apt update
$ sudo apt upgrade libedgetpu1-std

Here is the correct version for reference:

mendel@purple-orange:~$ dpkg -l | grep edgetpu
ii  edgetpudemo                          3-1                                 all          Edge TPU demo script
ii  libedgetpu1-max:arm64                14.0                                arm64        Support library for Edge TPU
ii  python3-edgetpu                      14.0                                arm64        Edge TPU Python API
ii  python3-edgetpuvision                6-1                                 arm64        EdgeTPU camera API