How do you load a model from Assets on Android in C++? #15856
Replies: 3 comments
-
Also, I would like to point out that this model has been successfully been converted to NCNN and used in our application through the C++ interface for the last 9 months. This exact model file in fact has been successfully converted and used, so corrupted model file is not likely. |
Beta Was this translation helpful? Give feedback.
-
I did some more digging into the API, and now I believe that this is caused by the API returning a mismatched API for some reason. Could this be a project setup problem? If it is, there really needs to be a better error message and more information about the problem to allow for easier debugging of this issue. Once I confirm this I'll be converting this into an issue. |
Beta Was this translation helpful? Give feedback.
-
Ok, this is really odd. I just traced back to where the OrtStatus is being created. If it is created with a nullptr it is considered a success. However, if it is created with anything else, it is considered a failure. In this case it is being created with a NULL, which is not a nullptr, and thus I fail with an empty useless status. Something is wrong, and it is likely because I'm running native code in a Java environment. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am attempting to incorporate onnx into our application, but I can't even get the session started. It's returning an ORT_ILLEGAL_ARGUMENT error. After some debugging it seems to be failing right after it checks the argument for the SessionOptions, and the only arguments left are those for the model file. I can't seem to figure out what argument is the problem here, so I will post the minimum code example of the issue so you can see. Maybe you can help.
I have also tried just giving the file name to Ort::Session as well, but switched to this method in case it was because it couldn't find the model file in question. I have based my wrapper design on #7790 but in this issue there was no mention of this Illegal Argument at all and I can see no reason why my code should produce one.
Beta Was this translation helpful? Give feedback.
All reactions