-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[Web] no available backend found. ERR: [wasm] TypeError: _ is not a function, [cpu] Error: previous call to 'initializeWebAssembly()' failed., [xnnpack] Error: previous call to 'initializeWebAssembly()' failed #18938
Comments
env.wasm.wasmPaths = {
"ort-wasm.wasm": window.location.origin + "/static/aiResource/js/ort-wasm-simd.wasm",
"ort-wasm-simd.wasm":
window.location.origin + "/static/aiResource/js/ort-wasm-simd.wasm",
"ort-wasm-threaded.wasm":
window.location.origin + "/static/aiResource/js/ort-wasm-simd.wasm",
"ort-wasm-simd-threaded.wasm":
window.location.origin + "/static/aiResource/js/ort-wasm-simd.wasm",
}; you cannot override the path like this. onnxruntime-web need those 4 different web assembly files. If you override every web assembly file to ort-wasm-simd.wasm, it will work only when SIMD is ON and multi-thread is OFF. |
Is that possible to override ort-wasm-simd-threaded.jsep.wasm? @fs-eire |
No... but in your case you can simply override as string: env.wasm.wasmPaths = window.location.origin + "/static/aiResource/js/"; this applies to every wasm file that used |
May I ask if you have solved this problem? I would like to ask for specific solutions. |
This problem is likely caused by mismatch of the webassembly files. (eg. override ort-wasm.wasm as ort-wasm-threaded.wasm from the other path). As I explained, the config |
I changed my code: It's amazing that the development environment is normal, and once published online, errors occur. |
The file does not cross domains. |
I think for the proxy, it is a separated issue. The buffer that you used to create input tensor is transferred to worker so if you reuse it and send it the second time it shows that error. A workaround is to create or clone the underlying ArrayBuffer every time you put them as inputs. (TypedArray.slice) |
Now |
i use onnxruntime-web": "^1.16.3", still reporting an error. |
I can use the static resource ort.wasm.min.js to publish online and run normally. But through Vue cli, the development environment is normal, but there are issues with the online environment. The new project I built with Vue cli basically doesn't have any other plugins. Is there a compatibility issue with Vue cli. |
Could you try version 1.17.0-dev.20240110-5f3113ecd6? We have a package export and bundler update after 1.16.3 and I assume it should work with Vue |
env.debug = true;
} I ran into this issue when I tried to run the runModel method; onnxruntime-web.js?v=8fab56b0:72 Uncaught (in promise) Error: no available backend found. ERR: [wasm] TypeError: Cannot read properties of undefined (reading 'buffer'), [cpu] Error: previous call to 'initializeWebAssembly()' failed., [xnnpack] Error: previous call to 'initializeWebAssembly()' failed. |
This error message may indicate that |
Describe the issue
hi,I have a question,i use vue build project
[email protected]
code :
Everything is normal. However, when released to the production environment, the above issues arise;
error no available backend found. ERR: [wasm] TypeError: _ is not a function, [cpu] Error: previous call to 'initializeWebAssembly()' failed., [xnnpack] Error: previous call to 'initializeWebAssembly()' failed
I see that the file loading status is all 200, but the program is not executing
To reproduce
When I add a row of settings
env.wasm.proxy = true;
Everything is normal, but there will be an error when parsing again.
error: "DataCloneError: Failed to execute 'postMessage' on 'Worker': ArrayBuffer at index 0 is already detached."
Urgency
No response
ONNX Runtime Installation
Built from Source
ONNX Runtime Version or Commit ID
1.14.0
Execution Provider
'wasm'/'cpu' (WebAssembly CPU)
The text was updated successfully, but these errors were encountered: