AttributeError: 'Delegate' object has no attribute '_library'

AttributeError: 'Delegate' object has no attribute '_library'

我正在使用 Coral 开发板,但我遇到了一个我无法摆脱的错误。我正在尝试 运行 在 edgetpu 上使用官方 tutorial 的图像分类器示例来开始使用 Dev Board。但是当我 运行

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

我收到以下错误

  File "classify_image.py", line 118, in <module>
    main()
  File "classify_image.py", line 95, in main
    interpreter = make_interpreter(args.model)
  File "classify_image.py", line 69, in make_interpreter
    {'device': device[0]} if device else {})
  File "/home/mendel/.local/lib/python3.5/site-packages/tflite_runtime/interpreter.py", line 165, in load_delegate
    delegate = Delegate(library, options)
  File "/home/mendel/.local/lib/python3.5/site-packages/tflite_runtime/interpreter.py", line 89, in __init__
    self._library = ctypes.pydll.LoadLibrary(library)
  File "/usr/lib/python3.5/ctypes/__init__.py", line 425, in LoadLibrary
    return self._dlltype(name)
  File "/usr/lib/python3.5/ctypes/__init__.py", line 347, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: /usr/lib/aarch64-linux-gnu/libc++abi.so.1: undefined symbol: _Unwind_GetRegionStart
Exception ignored in: <bound method Delegate.__del__ of <tflite_runtime.interpreter.Delegate object at 0xffff76ecff98>>
Traceback (most recent call last):
  File "/home/mendel/.local/lib/python3.5/site-packages/tflite_runtime/interpreter.py", line 124, in __del__
    if self._library is not None:
AttributeError: 'Delegate' object has no attribute '_library'

看起来告诉解释器在 TPU 上委托操作的方式不正确。 我看到许多人面临同样的错误,但其中 none 人找到了解决方案。 你有什么想法 ?提前致谢。

根据您上面的回答,您 运行 使用的是旧版本的 MendelOS。较新的内核应该是 4.14.98-imx 而不是 4.9.51-imx。另外,猫 /etc/os-release:

PRETTY_NAME="Mendel GNU/Linux 4 (Day)"
NAME="Mendel GNU/Linux"
ID=mendel
ID_LIKE=debian
HOME_URL="https://coral.withgoogle.com/"
SUPPORT_URL="https://coral.withgoogle.com/"
BUG_REPORT_URL="https://coral.withgoogle.com/"
VERSION_CODENAME="day"

请按照此处的说明使用新的系统映像重新刷写电路板:

https://coral.ai/docs/dev-board/reflash/#flash-a-new-system-image