Git Product home page Git Product logo

Comments (5)

skottmckay avatar skottmckay commented on July 21, 2024

Hard to say without a stack trace. with symbol names

ORT will do most allocations during model initialization and the first inference. After that it's using a cache for memory so segfaults would typically be an out-of-memory scenario or bad input (e.g. input tensor is freed while ORT is using it).

If you're building from source can you build a debug version? May need to ensure the Android build doesn't strip the binary of symbols though as typically it.

Does the issue happen if you run on the Android emulator? Would be easier to debug if it did.

Another option would be to copy onnxruntime_perf_test using adb to the phone (use /data/local/tmp), along with the model, and run. you can specify the number of iterations or amount of time to run for, and it can generate dummy input data.

from onnxruntime.

laurenspriem avatar laurenspriem commented on July 21, 2024

Hi @skottmckay thanks for your response.

I have created an MRE in the form of a demo app that has the bug. Please check out this repo. The bug is reproducible on Android emulator, it will crash anywhere in the range of 100-1000 inference runs, which should only take a few minutes to reach. Does this help in debugging?

I would like to provide a stack trace of the crash also, but I don't know how to get that on the native layer. Any pointers you can give me for that? In any case, I appreciate the help :)

from onnxruntime.

Windsander avatar Windsander commented on July 21, 2024

this issue same with :
#21097

which I solved by including generated header files.
In my case, it's caused by function mapping.
maybe you can try. Hope it helps. 0x0

from onnxruntime.

skottmckay avatar skottmckay commented on July 21, 2024

@laurenspriem is it reproducible by running onnxruntime_perf_test in a shell on the emulator? If so that would rule out the issue being in the flutter plugin you're using (which we don't own).

Use adb push <file> /data/local/tmp to copy onnxruntime_perf_test and your model to /data/local/tmp. Using adb shell, chmod +x /data/local/tmp/onnxruntime_perf_test to make it executable. cd /data/local/tmp. ./onnxruntime_perf_test -I -r 2000 <model.onnx> will run the model 1000 times, generating random input that matches the model inputs. If that does not crash, most likely the issue is with the flutter plugin.

May be possible to get symbols using ndk-stack: https://developer.android.com/ndk/guides/ndk-stack.html

from onnxruntime.

laurenspriem avatar laurenspriem commented on July 21, 2024

I am trying to run onnxruntime_perf_test in the emulator as you suggested. However, it stops and gives me the following text back:

/onnxruntime/onnxruntime/test/onnx/TestCase.cc:705 OnnxTestCase::OnnxTestCase(const std::string &, std::unique_ptr<TestModelInfo>, double, double) test case dir doesn't exist

Any clue what is going wrong?

from onnxruntime.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.