您好,
我一直在针对i.MX8MQ EVK的多个安卓电路板支持包版本上测试TensorFlow Lite 物体检测演示,但是无法成功启用 GPU 委托。
推理在 CPU 上运行正常,但切换到 GPU 委托时,初始化失败,推理无法启动。
| SoC | 恩智浦 i.MX8MQ |
| Android BSP | android-16.0.0_1.0.0 / android-15.0.0_2.0.0 / android-14.0.0_1.2.0 |
| 演示 | TensorFlow Lite 对象检测(来自 TensorFlow) |
| GPU | Vivante GC7000Lite |
| NPU | 未使用 |
该程序在 CPU 推理时运行正常,但在启用 GPU 委托时却无法初始化。
以下是 GPU 模式下的一些相关日志信息:
2025-09-11 20:05:58.595 libEGL E call to OpenGL ES API with no current context (logged once per thread)
2025-09-11 20:05:55.994 Surface E IGraphicBufferProducer::setBufferCount(0) returned Invalid argument
2025-09-11 20:05:56.086 BaseTaskApi W Closing an already closed native lib在代码中:
if (CompatibilityList().isDelegateSupportedOnThisDevice) {
baseOptionsBuilder.useGpu()
activeDelegate = "GPU"
} else {
objectDetectorListener?.onError("GPU is not supported on this device") // also print this !!!!!!!!!!!!
}我已经检查过了:
非常感谢你的答复。我已经解决了这个问题。我还提到了这份文件。 i.MX TensorFlow Lite 安卓版用户指南
嗨,汉克:
i.MX8MQ Android BSP 不支持现有的 TFLite GPU 委托,这是由于 GPU 后端兼容性和恩智浦选择的加速策略所致。 在 i.MX8M 上使用 VX (TIM-VX) 委托,在 i.MX95 上使用 Neutron 委托。