Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About Android calling TensorFlow Lite crash problem #60030

Closed
polarbbb opened this issue Mar 17, 2023 · 4 comments
Closed

About Android calling TensorFlow Lite crash problem #60030

polarbbb opened this issue Mar 17, 2023 · 4 comments
Assignees
Labels
comp:lite TF Lite related issues stale This label marks the issue/pr stale - to be closed automatically if no activity stat:awaiting response Status - Awaiting response from author TF 2.11 Issues related to TF 2.11 TFLiteConverter For issues related to TFLite converter type:support Support issues

Comments

@polarbbb
Copy link

1. Problem overview

I recently reported an error when importing the Tensorflow Lite model using Android Studio, but I did not find the problem after searching. I hope you can help me. The following is the detailed information

2. System information

-implementation 'org.tensorflow:tensorflow-lite:2.11.0'
-implementation 'org.tensorflow:tensorflow-lite-select-tf-ops:0.0.0-nightly'
-implementation 'org.tensorflow:tensorflow-lite-support:0.1.0'
-implementation 'org.tensorflow:tensorflow-lite-metadata:0.1.0'
-Android 12.0 x86_64

3. Code

  public MyModelRunner(Context context) throws IOException {
          try {
              interpreter = new Interpreter(loadModelFile(context));
  
          } catch (IOException e) {
              e.printStackTrace();
          }
      }

private MappedByteBuffer loadModelFile(Context context) throws IOException {


    AssetFileDescriptor fileDescriptor = context.getAssets().openFd("new_model.tflite");

    FileInputStream inputStream = new FileInputStream(fileDescriptor.getFileDescriptor());

    FileChannel fileChannel = inputStream.getChannel();

    long startOffset = fileDescriptor.getStartOffset();
    long declaredLength = fileDescriptor.getDeclaredLength();

    return fileChannel.map(FileChannel.MapMode.READ_ONLY, startOffset, declaredLength);
}

4. (optional) info / logs

2023-03-17 18:02:45.343 22670-22670 libc com.example.myproject01 A Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xfffffff4 in tid 22670 (ple.myproject01), pid 22670 (ple.myproject01)
2023-03-17 18:02:45.399 22706-22706 DEBUG pid-22706 A pid: 22670, tid: 22670, name: ple.myproject01 >>> com.example.myproject01 <<<
2023-03-17 18:02:45.637 22706-22706 DEBUG pid-22706 A #00 pc 00282792 /data/app/~~8c21WzJfTIFEm7pmQFGjow==/com.example.myproject01-zu0b6G7gIfCmfZkzPmHgpg==/lib/x86/libtensorflowlite_flex_jni.so
2023-03-17 18:02:45.637 22706-22706 DEBUG pid-22706 A #1 pc 020242b8 /data/app/~~8c21WzJfTIFEm7pmQFGjow==/com.example.myproject01-zu0b6G7gIfCmfZkzPmHgpg==/lib/x86/libtensorflowlite_flex_jni.so
2023-03-17 18:02:45.637 22706-22706 DEBUG pid-22706 A #2 pc 02023ec2 /data/app/~~8c21WzJfTIFEm7pmQFGjow==/com.example.myproject01-zu0b6G7gIfCmfZkzPmHgpg==/lib/x86/libtensorflowlite_flex_jni.so
2023-03-17 18:02:45.637 22706-22706 DEBUG pid-22706 A #3 pc 0202456b /data/app/~~8c21WzJfTIFEm7pmQFGjow==/com.example.myproject01-zu0b6G7gIfCmfZkzPmHgpg==/lib/x86/libtensorflowlite_flex_jni.so
2023-03-17 18:02:45.637 22706-22706 DEBUG pid-22706 A #4 pc 01e6f187 /data/app/~~8c21WzJfTIFEm7pmQFGjow==/com.example.myproject01-zu0b6G7gIfCmfZkzPmHgpg==/lib/x86/libtensorflowlite_flex_jni.so
2023-03-17 18:02:45.637 22706-22706 DEBUG pid-22706 A #5 pc 0027cb45 /data/app/~~8c21WzJfTIFEm7pmQFGjow==/com.example.myproject01-zu0b6G7gIfCmfZkzPmHgpg==/lib/x86/libtensorflowlite_flex_jni.so
2023-03-17 18:02:45.639 22706-22706 DEBUG pid-22706 A #37 pc 002e6bdc [anon:dalvik-classes.dex extracted in memory from /data/app/~~8c21WzJfTIFEm7pmQFGjow==/com.example.myproject01-zu0b6G7gIfCmfZkzPmHgpg==/base.apk] (org.tensorflow.lite.flex.FlexDelegate.+4)
2023-03-17 18:02:45.640 22706-22706 DEBUG pid-22706 A #60 pc 002e47ae [anon:dalvik-classes.dex extracted in memory from /data/app/~~8c21WzJfTIFEm7pmQFGjow==/com.example.myproject01-zu0b6G7gIfCmfZkzPmHgpg==/base.apk] (org.tensorflow.lite.NativeInterpreterWrapper.maybeCreateFlexDelegate+6)
2023-03-17 18:02:45.641 22706-22706 DEBUG pid-22706 A #63 pc 002e4be4 [anon:dalvik-classes.dex extracted in memory from /data/app/~~8c21WzJfTIFEm7pmQFGjow==/com.example.myproject01-zu0b6G7gIfCmfZkzPmHgpg==/base.apk] (org.tensorflow.lite.NativeInterpreterWrapper.addDelegates+16)
2023-03-17 18:02:45.641 22706-22706 DEBUG pid-22706 A #66 pc 002e4e68 [anon:dalvik-classes.dex extracted in memory from /data/app/~~8c21WzJfTIFEm7pmQFGjow==/com.example.myproject01-zu0b6G7gIfCmfZkzPmHgpg==/base.apk] (org.tensorflow.lite.NativeInterpreterWrapper.init+104)
2023-03-17 18:02:45.641 22706-22706 DEBUG pid-22706 A #69 pc 002e4baa [anon:dalvik-classes.dex extracted in memory from /data/app/~~8c21WzJfTIFEm7pmQFGjow==/com.example.myproject01-zu0b6G7gIfCmfZkzPmHgpg==/base.apk] (org.tensorflow.lite.NativeInterpreterWrapper.+146)
2023-03-17 18:02:45.641 22706-22706 DEBUG pid-22706 A #72 pc 002e44d0 [anon:dalvik-classes.dex extracted in memory from /data/app/~~8c21WzJfTIFEm7pmQFGjow==/com.example.myproject01-zu0b6G7gIfCmfZkzPmHgpg==/base.apk] (org.tensorflow.lite.NativeInterpreterWrapperExperimental.)
2023-03-17 18:02:45.641 22706-22706 DEBUG pid-22706 A #75 pc 002e4304 [anon:dalvik-classes.dex extracted in memory from /data/app/~~8c21WzJfTIFEm7pmQFGjow==/com.example.myproject01-zu0b6G7gIfCmfZkzPmHgpg==/base.apk] (org.tensorflow.lite.Interpreter.+4)
2023-03-17 18:02:45.641 22706-22706 DEBUG pid-22706 A #78 pc 002e42e6 [anon:dalvik-classes.dex extracted in memory from /data/app/~~8c21WzJfTIFEm7pmQFGjow==/com.example.myproject01-zu0b6G7gIfCmfZkzPmHgpg==/base.apk] (org.tensorflow.lite.Interpreter.+2)
2023-03-17 18:02:45.642 22706-22706 DEBUG pid-22706 A #81 pc 00000f66 /data/data/com.example.myproject01/code_cache/.overlay/base.apk/classes3.dex (com.example.myproject01.MyModelRunner.+18)
2023-03-17 18:02:45.642 22706-22706 DEBUG pid-22706 A #84 pc 00000fc8 /data/data/com.example.myproject01/code_cache/.overlay/base.apk/classes3.dex (com.example.myproject01.Recommend_Fragment$1.onClick+20)
---------------------------- PROCESS ENDED (22670) for package com.example.myproject01 ----------------------------
2023-03-17 18:02:45.957 518-597 InputDispatcher system_process E channel 'c1e13a6 com.example.myproject01/com.example.myproject01.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!

@polarbbb polarbbb added the TFLiteConverter For issues related to TFLite converter label Mar 17, 2023
@synandi synandi added comp:lite TF Lite related issues type:support Support issues labels Mar 17, 2023
@synandi synandi assigned pjpratik and unassigned synandi Mar 18, 2023
@pjpratik pjpratik added the TF 2.11 Issues related to TF 2.11 label Mar 20, 2023
@pjpratik
Copy link
Contributor

Hi @polarbbb Thanks for reporting the issue.

Can you confirm the model is in Assets folder. Please check this relevant thread #55123 and see if t helps.

If not, can you please provide the steps you have followed to encounter issue.

Thanks.

@pjpratik pjpratik added the stat:awaiting response Status - Awaiting response from author label Mar 20, 2023
@github-actions
Copy link

This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you.

@github-actions github-actions bot added the stale This label marks the issue/pr stale - to be closed automatically if no activity label Mar 28, 2023
@github-actions
Copy link

github-actions bot commented Apr 5, 2023

This issue was closed because it has been inactive for 7 days since being marked as stale. Please reopen if you'd like to work on this further.

@github-actions github-actions bot closed this as completed Apr 5, 2023
@google-ml-butler
Copy link

Are you satisfied with the resolution of your issue?
Yes
No

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:lite TF Lite related issues stale This label marks the issue/pr stale - to be closed automatically if no activity stat:awaiting response Status - Awaiting response from author TF 2.11 Issues related to TF 2.11 TFLiteConverter For issues related to TFLite converter type:support Support issues
Projects
None yet
Development

No branches or pull requests

3 participants