提问人:p o 提问时间:11/17/2023 最后编辑:desertnautp o 更新时间:11/18/2023 访问量:10
如何修复 Raspberry Pi 上的 flex 委托错误
How to fix flex delegate error on Raspberry Pi
问:
我正在努力检测使用轮椅、助行器等的人。我一直在关注这个视频,学习如何创建和训练自定义模型,并成功地在我的 PC 上运行了我的自定义模型,并进行了工作对象检测。我打算只在我的 Raspberry Pi 上使用此自定义模型,因此我按照此视频了解如何将我的模型转换为 tflite 格式,以及重新创建我的标签图以使其与 Raspberry Pi 兼容。但是,在转换我的自定义模型并尝试在我的 Raspberry Pi 上运行它时,它给了我这个错误:
ERROR: Select TensorFlow op(s), included in the given model, is(are) not supported by this interpreter. Make sure you apply/link the Flex delegate before inference. For the Android, it can be resolved by adding "org.tensorflow:tensorflow-lite-select-tf-ops" dependency. See instructions: https://www.tensorflow.org/lite/guide/ops_select
ERROR: Node number 1 (FlexTensorListReserve) failed to prepare.
Traceback (most recent call last):
File "/home/Python/tLite/examples/lite/examples/object_detection/raspberry_pi/detect.py", line 151, in <module>
main()
File "/home/Python/tLite/examples/lite/examples/object_detection/raspberry_pi/detect.py", line 146, in main
run(args.model, int(args.cameraId), args.frameWidth, args.frameHeight,
File "/home/Python/tLite/examples/lite/examples/object_detection/raspberry_pi/detect.py", line 63, in run
detector = vision.ObjectDetector.create_from_options(options)
File "/home/.local/lib/python3.9/site-packages/tensorflow_lite_support/python/task/vision/object_detector.py", line 87, in create_from_options
detector = _CppObjectDetector.create_from_options(
RuntimeError: AllocateTensors() failed.
我已经尝试了多个不同的教程,了解如何从头开始设置 Raspberry Pi 以在 Raspberry Pi 上导入和运行自定义 TFite 模型,并且仍在重新创建相同的错误。
Traceback (most recent call last):
File "/home/tflite1/TFLite_detection_webcam.py", line 141, in <module>
interpreter.allocate_tensors()
File "/home/tflite1/tflite1-env/lib/python3.9/site-packages/tflite_runtime/interpreter.py", line 408, in allocate_tensors
return self._interpreter.AllocateTensors()
RuntimeError: Regular TensorFlow ops are not supported by this interpreter. Make sure you apply/link the Flex delegate before inference.Node number 1 (FlexTensorListReserve) failed to prepare.
如何解决此错误?可能是在将我的自定义模型转换为 tflite 时导致错误,因为所有其他教程都提供了我在 Raspberry Pi 上使用的示例模型(例如这个),但是,当我添加我的自定义模型时,当我同时添加我的 tflite 和 labelmap 文件时,它给了我相同的 flex 委托错误。或者是我忘记包含的其他内容,因为我的自定义模型目前在我的 PC 上运行,但不在我的 Raspberry Pi 上运行。我正在使用 Efficientdet_d0 和 Python 3.9.2。非常感谢任何帮助/建议,谢谢!
尝试了许多不同类型的教程,这些教程与在 Raspberry Pi 上设置 tflite 示例模型以及使用 tflite 和 labelmap 文件输入我的自定义模型有关。将默认模型编辑为我自己的模型,但仍然得到相同的错误。
答: 暂无答案
评论