Replies: 1 comment
-
Hello, yes, it looks like a configuration issue since the correctly generated WebAssembly files should come with the npm package. I've found these related issues, both of which suggest copying the *.wasm files (which will be found in ./dist) to ./public/js when using React, along with other detailed troubleshooting steps: #11413 #9322 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi guys, I'm quite new to web development, but I would like to build a very simple react component in which I can do some inference with a model. However, I have been stuck for DAYS on a simple issue.
I created by react app with create-react-app. I then run npm install onnxruntime-web. After deleting the files from the react project which are not relevant for the minimal example (App.css, logo.svg and so on) , I am left with App.js in which I have the following code :
And a index.js :
Now, this gives me the following error when running npm start and going to the app's webpage :
My (not very educated) guess is that is has to do with the webpack configuration automatically generated with create-react-app, but I'm not certain. The strange this, is if I remove the ort.InferenceSession.create('./model.onnx'), with something else using the package, say ort.Tensor = something, then it works fine, so I guess the ort imports works ok.
Of course, index.js, App.js are all in the same directory, src. I put model.onnx both in the public folder and in src, just in case.
I am really at my wits end, I have no idea what to try next. Could you explain to me what is wrong or if there is any resource that I missed that solves this problem ?
Beta Was this translation helpful? Give feedback.
All reactions