【发布时间】:2021-09-13 09:26:56
【问题描述】:
当我尝试使用 tflite GPU 时,我的应用程序崩溃了。我正在使用MoveNet 模型从这里click。我在 CPU 中运行此模型时没有出错。
这是我的解释器初始化代码。
val compatList = CompatibilityList()
val options = Interpreter.Options().apply{
if(compatList.isDelegateSupportedOnThisDevice){
// if the device has a supported GPU, add the GPU delegate
val delegateOptions = compatList.bestOptionsForThisDevice
this.addDelegate(GpuDelegate(delegateOptions))
} else {
// if the GPU is not supported, run on 4 threads
this.setNumThreads(8)
}
}
interpreter = Interpreter(loadTFFile(),options)
gradle(模块):
implementation 'org.tensorflow:tensorflow-lite:2.3.0'
implementation 'org.tensorflow:tensorflow-lite-gpu:2.3.0'
implementation 'org.tensorflow:tensorflow-lite-support:0.1.0'
错误:
java.lang.IllegalArgumentException: Internal error: Failed to apply delegate: Following operations are not supported by GPU delegate:
ARG_MAX: Operation is not supported.
CAST: Operation is not supported.
CONCATENATION: OP is supported, but tensor type isn't matched!
DEQUANTIZE:
FLOOR_DIV: Operation is not supported.
GATHER_ND: Operation is not supported.
MUL: OP is supported, but tensor type isn't matched!
PACK: Operation is not supported.
RESHAPE: OP is supported, but tensor type isn't matched!
SUB: OP is supported, but tensor type isn't.
我正在 android 8.1 上测试这个
【问题讨论】: