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

[Mobile] #19753

Closed
hubin858130 opened this issue Mar 4, 2024 · 1 comment
Closed

[Mobile] #19753

hubin858130 opened this issue Mar 4, 2024 · 1 comment
Labels
model:transformer issues related to a transformer model: BERT, GPT2, Hugging Face, Longformer, T5, etc. platform:mobile issues related to ONNX Runtime mobile; typically submitted using template

Comments

@hubin858130
Copy link

hubin858130 commented Mar 4, 2024

Describe the issue

The inswapper_128. onnx model of Insightface can be successfully run on MacOS using the Python library, and also on Mac OS using onnxruntime c++1.17.0 version. But on Android 11 and Android 13, multiple phones have failed to run, and an error was reported when creating a new session. The specific error is:
Fatal signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x742e534b7c in tid 15185 (Thread-2), pid 15155 (tern.inswapdemo)
Cmdline: com.lantern.inswapdemo
pid: 15155, tid: 15185, name: Thread-2 >>> com.lantern.inswapdemo <<<
#9 pc 0000000000ca8418 /data/app/~~9ObP6OPYprJdNxgoP2LQnQ==/com.lantern.inswapdemo-AUa6PQFIG3ek8Kd8v4B_YQ==/base.apk!libonnxruntime.so (BuildId: d6de1672c0b55de5c0fcb82f99789ac38faa2823)
#10 pc 0000000000c9c3cc /data/app/~~9ObP6OPYprJdNxgoP2LQnQ==/com.lantern.inswapdemo-AUa6PQFIG3ek8Kd8v4B_YQ==/base.apk!libonnxruntime.so (BuildId: d6de1672c0b55de5c0fcb82f99789ac38faa2823)
#11 pc 0000000000c9bb10 /data/app/~~9ObP6OPYprJdNxgoP2LQnQ==/com.lantern.inswapdemo-AUa6PQFIG3ek8Kd8v4B_YQ==/base.apk!libonnxruntime.so (BuildId: d6de1672c0b55de5c0fcb82f99789ac38faa2823)
#12 pc 0000000000449c98 /data/app/~~9ObP6OPYprJdNxgoP2LQnQ==/com.lantern.inswapdemo-AUa6PQFIG3ek8Kd8v4B_YQ==/base.apk!libonnxruntime.so (BuildId: d6de1672c0b55de5c0fcb82f99789ac38faa2823)
#13 pc 00000000004480ac /data/app/~~9ObP6OPYprJdNxgoP2LQnQ==/com.lantern.inswapdemo-AUa6PQFIG3ek8Kd8v4B_YQ==/base.apk!libonnxruntime.so (BuildId: d6de1672c0b55de5c0fcb82f99789ac38faa2823)
#14 pc 000000000044a800 /data/app/~~9ObP6OPYprJdNxgoP2LQnQ==/com.lantern.inswapdemo-AUa6PQFIG3ek8Kd8v4B_YQ==/base.apk!libonnxruntime.so (BuildId: d6de1672c0b55de5c0fcb82f99789ac38faa2823)
#15 pc 000000000042dd90 /data/app/~~9ObP6OPYprJdNxgoP2LQnQ==/com.lantern.inswapdemo-AUa6PQFIG3ek8Kd8v4B_YQ==/base.apk!libonnxruntime.so (BuildId: d6de1672c0b55de5c0fcb82f99789ac38faa2823)
#16 pc 000000000042d9c0 /data/app/~~9ObP6OPYprJdNxgoP2LQnQ==/com.lantern.inswapdemo-AUa6PQFIG3ek8Kd8v4B_YQ==/base.apk!libonnxruntime.so (BuildId: d6de1672c0b55de5c0fcb82f99789ac38faa2823)
#17 pc 00000000001a7810 /data/app/~~9ObP6OPYprJdNxgoP2LQnQ==/com.lantern.inswapdemo-AUa6PQFIG3ek8Kd8v4B_YQ==/base.apk!libinswapface.so (Ort::Session::Session(Ort::Env const&, char const*, Ort::SessionOptions const&)+100) (BuildId: 2487feab461a4bbf467d05ce0f982f844831a613)

I encountered the same error when converting the model to FP16 using float16. The onnxruntime versions for Android are 1.16.3, 1.17.0, and 1.17.1, and they all crash.

Additionally, I found that using onnxruntime-android-1.17.0.aar can load the onnx model. But when i unzip the aar file , load library onnxruntime.so and write Jni myself, it always crashes.

To reproduce

code:
const char* modelpath = "/sdcard/inswapper_128.onnx";
Env env = Env(ORT_LOGGING_LEVEL_INFO, "inswp");
Ort::Session *ort_session = nullptr;
SessionOptions sessionOptions = SessionOptions();
sessionOptions.SetGraphOptimizationLevel(ORT_ENABLE_ALL);
ort_session = new Session(env, modelpath, sessionOptions);

model:
https://huggingface.co/ezioruan/inswapper_128.onnx/blob/main/inswapper_128.onnx

android onnxruntime:
https://mvnrepository.com/artifact/com.microsoft.onnxruntime/onnxruntime-android

Urgency

No response

Platform

Android

OS Version

11、12、13

ONNX Runtime Installation

Released Package

Compiler Version (if 'Built from Source')

No response

Package Name (if 'Released Package')

onnxruntime-android

ONNX Runtime Version or Commit ID

1.16.3、1.17.0、1.17/1

ONNX Runtime API

C++/C

Architecture

X64

Execution Provider

Other / Unknown

Execution Provider Library Version

No response

@hubin858130 hubin858130 added the platform:mobile issues related to ONNX Runtime mobile; typically submitted using template label Mar 4, 2024
@github-actions github-actions bot added the model:transformer issues related to a transformer model: BERT, GPT2, Hugging Face, Longformer, T5, etc. label Mar 4, 2024
@hubin858130
Copy link
Author

Sorry,I have discovered a definition that may cause stack overflow, in the .h file,I defined float[512][512],when i removed this 2 dims array,onnxruntime could load the onnx file.
Ok,I will close this issuse!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
model:transformer issues related to a transformer model: BERT, GPT2, Hugging Face, Longformer, T5, etc. platform:mobile issues related to ONNX Runtime mobile; typically submitted using template
Projects
None yet
Development

No branches or pull requests

1 participant