所以我正在尝试在 Android 应用程序上使用 Tensorflow Lite。当相机捕捉图像时调用以下代码:
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
if (requestCode == REQUEST_IMAGE_CAPTURE && resultCode == RESULT_OK) {
val bitmap = data!!.extras!!.get("data") as Bitmap
val tensorImage = imageProcessor.process(TensorImage(DataType.UINT8).apply { load(bitmap) })
val outputs = model.process(tensorImage.tensorBuffer)
val buffer = outputs.outputFeature0AsTensorBuffer
val prediction = buffer.floatArray
debug { "$prediction" }
}
}
但是执行
val outputs = model.process(tensorImage.tensorBuffer)
行后,报错信息
E/libc: Access denied finding property "ro.hardware.chipname"
弹出。我对消息的含义一无所知(即使在谷歌搜索之后),而且我似乎找不到合适的许可来允许这样做。非常感谢任何提前的帮助。
我在我的 flutter/dart 项目中确实遇到了同样的问题,当时我试图在小米红米 K30 Pro(骁龙 865)上使用 NNAPI。直到现在,还没有关于这方面的具体信息。 我发现的几页可能与它有关: