DNNLibrary | Daquexian's NNAPI Library ONNX + Android NNAPI | Game Engine library
kandi X-RAY | DNNLibrary Summary
kandi X-RAY | DNNLibrary Summary
Android 8.1 introduces NNAPI. However, NNAPI is not friendly to normal Android developers. It is not designed to be used by normal developers directly. So I wrapped it into a library.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of DNNLibrary
DNNLibrary Key Features
DNNLibrary Examples and Code Snippets
Community Discussions
Trending Discussions on DNNLibrary
QUESTION
I need to run a custom GluonCV object detection module on Android.
I already fine-tuned the model (ssd_512_mobilenet1.0_custom) on a custom dataset, I tried running inference with it (loading the .params file produced during the training) and everything works perfectly on my computer. Now, I need to export this to Android.
I was referring to this answer to figure out the procedure, there are 3 suggested options:
- You can use ONNX to convert models to other runtimes, for example [...] NNAPI for Android
- You can use TVM
- You can use SageMaker Neo + DLR runtime [...]
Regarding the first one, I converted my model to ONNX. However, in order to use it with NNAPI, it is necessary to convert it to daq. In the repository, they provide a precomplied AppImage of onnx2daq to make the conversion, but the script returns an error. I checked the issues section, and they report that "It actually fails for all onnx object detection models".
Then, I gave a try to DLR, since it's suggested to be the easiest way. As I understand, in order to use my custom model with DLR, I would first need to compile it with TVM (which also covers the second point mentioned in the linked post). In the repo, they provide a Docker image with some conversion scripts for different frameworks. I modified the 'compile_gluoncv.py' script, and now I have:
...ANSWER
Answered 2021-Mar-03 at 10:33The error message is self-explanatory - there is no model "ssd_512_mobilenet1.0_custom" supported by mxnet.gluon.model_zoo.vision.get_model
. You are confusing GluonCV's get_model
with MXNet Gluon's get_model
.
Replace
QUESTION
I wrote a demo of NNAPI. But The app crashes with the error "java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol 'ANeuralNetworksModel_identifyInputsAndOutputs'". After I removed the line contains ANeuralNetworksModel_identifyInputsAndOutputs(and remains other lines about NNAPI, such as ANeuralNetworksModel_addOperation and so on), the app doesn't crash anymore.
My minSdkVersion, compileSdkVersion, targetSdkVersion are all 27.
Is it a bug, or just my fault? Could you please help me? Thanks in advance.
Thanks to the excellent solution following, I have written an NNAPI wrapper Library and demo, and published it on GitHub, only four lines are needed to deploy a model on phone. I hope my project would help developers who interested in NNAPI
...ANSWER
Answered 2017-Nov-01 at 18:20Unfortunately there was a change to the NN API that was requested just before the NDK launch that didn't make it into O MR 1 Beta 1 in time. In other words, the NDK is more up to date than the beta image. This will resolve itself when the next O beta (or the release? I'm not actually sure what the timeline is) launches.
In the meantime, the name of that function in the beta is ANeuralNetworksModel_setInputsAndOutputs
. Something like the following should work, and will let you know when you can remove the workaround (note: I haven't tested this because I don't have a device running the beta, so it may require some minor modifications).
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install DNNLibrary
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page