python - AttributeError:“委托”对象没有属性“_library”
问题描述
我正在使用 Coral 开发板,但遇到了无法摆脱的错误。我正在尝试在 edgetpu 上运行官方教程的图像分类器示例以开始使用开发板。我一步一步地按照教程但是当我运行时
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 上委托操作的方式是不正确的。我看到很多人面临同样的错误,但没有人找到解决方案。你有什么想法 ?提前致谢。
解决方案
根据您上面的回答,您正在运行旧版本的 MendelOS。较新的内核应该4.14.98-imx
代替4.9.51-imx
. 另外,cat /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
推荐阅读
- swift - 在用户选择发送后添加到电子邮件正文中 | 迅速
- java - android os 从版本 9 升级到 10 后无法获取设备 ID
- matlab - 为什么会出现“无效使用运算符”错误?
- react-native - 无法在 ScrollableTabView 内呈现视图
- python-3.x - 猎鹰中的 msgpack.unpackb
- python - 为什么我的记分板上的分数没有更新?
- ruby-on-rails - 配置 RSpec 以在单元测试中调用 DB 时引发错误
- python-3.x - 如何在 python 中使用套接字建立 TCP/IP 连接。我不希望它是本地的,但可以从任何网络上的任何计算机(客户端)访问
- gtk - 如何使用 Vala 从字符串生成 QRCode 图像?
- javascript - Cytoscape.js 复合子节点 addClass 不显示样式