tflite-support
tflite-support copied to clipboard
Error getting native address of native library: task_vision_jni
I tried to export tflite using a custom model trained by yolov8 and run it on my Android app, but I got an error
I am confident that I will be able to use the model provided by the hub
MetaData
Metadata populated:
{
"name": "ObjectDetector",
"description": "Identify which of a known set of objects might be present and provide information about their positions within the given image or a video stream.",
"subgraph_metadata": [
{
"input_tensor_metadata": [
{
"name": "image",
"description": "Input image to be detected.",
"content": {
"content_properties_type": "ImageProperties",
"content_properties": {
"color_space": "RGB"
}
},
"process_units": [
{
"options_type": "NormalizationOptions",
"options": {
"mean": [
127.5
],
"std": [
127.5
]
}
}
],
"stats": {
"max": [
1.0
],
"min": [
-1.0
]
}
}
],
"output_tensor_metadata": [
{
"name": "location",
"description": "The locations of the detected boxes.",
"content": {
"content_properties_type": "BoundingBoxProperties",
"content_properties": {
"index": [
1,
0,
3,
2
],
"type": "BOUNDARIES"
},
"range": {
"min": 2,
"max": 2
}
},
"stats": {
}
}
],
"output_tensor_groups": [
{
"name": "detection_result",
"tensor_names": [
"location",
"category",
"score"
]
}
]
}
],
"min_parser_version": "1.2.0"
}
Associated file(s) populated:
file name: temp_meta.txt
file content:
b"{'description': 'Ultralytics best model (untrained)', 'author': 'Ultralytics', 'license': 'AGPL-3.0 https://ultralytics.com/license', 'date': '2023-08-05T07:56:12.447707', 'version': '8.0.147', 'stride': 32, 'task': 'detect', 'batch': 1, 'imgsz': [320, 320], 'names': {0: 'EXP', 1: 'GoldCoin', 2: 'RedDharma'}}"
file name: mobilenet_labels.txt
file content:
b'EXP\nGoldCoin\nRedDharma\n'
- i verify that the application has sufficient permissions and can read the file properly
'org.tensorflow:tensorflow-lite-task-vision:0.4.4'
i find the problem about output_meta only one,but need four and i don`t know how to add 4 output_meta with meta_writer
I'm having the same issue: Error getting native address of native library: task_vision_jni java.lang.IllegalArgumentException: Error occurred when initializing ObjectDetector: Mobile SSD models are expected to have exactly 4 outputs, found 1
don't know if it's relevant but i found differences between my model and the ones that came built
This is mine:
This is the built in one
in with the project
the input type and the min/max value is different.
bump with this
I'm getting this similar error but no complaints about the tensor objects, it fails on initialization itself, and the CPU works just fine, it seems to not be able to find the library (interface) task_vision_jni. Not sure if this is specific to the device (assuming this is supposed to be a native binary), as it doesn't work on the emulator either. I get the error Error occurred when initializing ObjectDetector: ModifyGraphWithDelegate() failed for delegate 'GPU'.
@bhimeshchauhan have you resolved? How?
Any updates with this??