-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[Lot of people have this issue] The model can not "really" do inference; Loading issue is solved. #10990
Comments
reproduable example https://github.com/JonathanSum/RN_Testing |
Is it possible that we will have a video step by step on how to set up the React Native ONNX model loading and inference? |
Same Issue: #9594 |
Hey ! Did you find any solutions? |
Could you please provide the code where you're able to load the model? |
I deleted my post. But I still want to repost it.
|
|
I am not really sure what the doc's saying:
'''' |
@JonathanSum Since you have opened and closed this issue many times and referenced a few other issues, can you clarify what you need help with at this time? |
I created a dummy tensor with dimension, dims = [1, 1, 28, 28]; In addition, the doc said it does not support unsigned tensor type because of RN library. I do not understand this. Is it saying JavaScript has an unsigned data type? In addition, I was trying to do NLP question and answering, and some model such as bert QA will use -1 to denote no answer. Does it mean ONNX RN can not work in those model because it may output -1. I think the real issue of this ONNX RN library is it can not be used like the ONNXJS. That is why we need an tutorial on how to load model and do inference for React Native in CV, NLP, ASR , and processing tensor. @faxu And that is why I told @FFPTech-Sebastien, this should be explained more detailly by ONNX team. |
Hi @JonathanSum, Sorry for the late response. I took some time to reproduce the issue from scratch. Following are answers to some of your questions:
The API should be totally same for ORT Nodejs, ORT Web and ORT RN. If it is not, we should fix it. There might be slightly differences in some details, like the URI of the model has different definition for Please let me know if you have further questions. |
I tried to input a dummy variable from Javascript and input it to the loaded ONNX model, and it just crashed my app and throw the error code in Android Studio(error code in above). Do you know why?
Can you tell me I can do an inference or not with the dummy tensor in above if the mist.ort model is loaded? |
Let me add more: I also pin another issue here because I think he had the same issue as I had before. See! I was able to load the model, but I can not do inference at the end. |
Hi Jonathan, could you please explain what you did in order to be able to load in the model? And also could you explain what |
I can't really give you a solution because I think it won't be much helpful at all, _especially you can't do inference like the docs. But I guess I know the solution. However, I guess you will find a better solution than mine and we should follow your solution. I hope ONNX will make it better because I trust the ONNX team(fs-eire,faxu, and more ). 😀😆😆😆😆 |
The documents are definitely not good enough to give a clean and straightforward instructions. I am working on reproducing the issues and marking the problems. After that I will send out PR to update the document (and the code, if any code change is necessary). |
@fs-eire |
I can reproduce this issue. The shape [1, 1, 28, 28] is correct. I am investigating the cause of the crash. BTW I am working on this repo: https://github.com/fs-eire/ort-rn-hello-world to log my steps of reproducing the issue. |
OK.. I think I was wrong. the shape actually requires [1, 28, 28] as dims. this is why it fails. however, crash is not the expected behavior. the correct behavior should reject the Promise with the error message. i will take a look at how to conduct a fix. |
I replied in the original issue. |
@fs-eire Just saw it, thank you very much for the update! I have a follow-up question in the original issue. |
#10302
Not only this was mentioned. There is also other users reported this issues
https://www.npmjs.com/package/onnxruntime-react-native
I tried to convert it to ort file format. And it doesn't work.
Reproduce repo: https://github.com/JonathanSum/RN_Testing
The text was updated successfully, but these errors were encountered: