So I am trying to use Tensorflow Lite on an android app. The following code is called when the camera captures an image:
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" }
}
}
However, after executing the line val outputs = model.process(tensorImage.tensorBuffer), an error message
E/libc: Access denied finding property "ro.hardware.chipname"
popped up. I have no clue about the meaning of the message (even after googling), and I seemingly cannot find a suitable permission to allow this. Any help in advance is much appreciated.
I did encounter the same problem in my flutter/dart project, when I was trying to use NNAPI on XiaoMi Redmi K30 Pro(Snapdragon 865). Until now, there's still no concrete information about this. Few pages i found which may have sth to do with it:
https://github.com/tensorflow/models/issues/7887
https://github.com/tensorflow/tensorflow/issues/45847
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With