failed to inference ONNX model: TypeError: Cannot read properties of undefined (reading 'InferenceSession') #15505
Replies: 6 comments 1 reply
-
Please create reproducible test repo |
Beta Was this translation helpful? Give feedback.
-
I created a brand new electron project with the bare minimum requirements in order to let you experiment and detect what's going on Steps to reproduce everything:
|
Beta Was this translation helpful? Give feedback.
-
Based on the already working
I copied the entire I set in
But I get the error I discovered that even if in
are not copied to the corresponding folder in
Steps to reproduce everything:
|
Beta Was this translation helpful? Give feedback.
-
Hello I am new to open source but want to contribute into this could you please provide me the resources required to contribute into it |
Beta Was this translation helpful? Give feedback.
-
your example is very huge.. so very hard to actually understand problem. Could you reduce repo to particularly part that should work? from upstream issue as I understand you need some help with configuration, but it is hard to understand what you want to achieve.. |
Beta Was this translation helpful? Give feedback.
-
Hi @vankop !! Thanks to |
Beta Was this translation helpful? Give feedback.
-
Bug report
Two weeks ago I opened a thread in
StackOverFlow
asking for help aboutONNX
not "read"/"loaded" bywebpack
:https://stackoverflow.com/questions/71067989/failed-to-inference-onnx-model-typeerror-cannot-read-properties-of-undefined
but didn't receive any help.
I wrote a
GitHub's issue
in the Microsoft's ONNX page: microsoft/onnxruntime#10516and, according to them : microsoft/onnxruntime#10516 (comment)
, in order to be able to load
ONNX
throughwebpack
, thewebpack.config.js
should have these traits:onnxruntime-web
NOT inexternals
,target
:web
, andNO alias
.What is the current behavior?
If the current behavior is a bug, please provide the steps to reproduce.
I get:
failed to inference ONNX model: TypeError: Cannot read properties of undefined (reading 'InferenceSession')
This is my complete
webpack.config.js
of myElectron-React-Typescript-Webpack
app:Microsoft's ONNX people suggested this:
"If you still cannot solve this issue, you need to dig deep into webpack to find the root cause. With imported value ort being undefined, there is little thing I can help in this stage"
So.... what else has to be included and / or modified in the
webpack.config.js
file, in order to makewebpack
correctly see and loadonnxruntime-web
?What is the expected behavior?
onnxruntime-web
should be recognized and loadedOther relevant information:
webpack version:
Node.js version:
Operating System:
Additional tools:
Beta Was this translation helpful? Give feedback.
All reactions