Comments (5)
env.wasm.wasmPaths = window.location.origin + "/node_modules/onnxruntime-web/dist/";
If you set this in the code, you also need to make sure the file is served by the server. I know that React has "dev" mode and "production" mode, and they may treat asset deployment differently. I am not an expert of React, so I cannot figure out the detail; but the whole idea is to make sure the URL of the .wasm file is actually valid ( which can be verified in your browser devtool, "Network" tab )
Thank you very much!!!
I have setted like this:ort.env.wasm.wasmPaths = "https://cdn.jsdelivr.net/npm/[email protected]/dist/"; but it also gives me error.
Now, I want to ensure that wheather i need to upgarde the onnxruntime-web
from onnxruntime.
It is related to deploying WebAssembly files. Please refer to #19831 (comment).
BTW, before version 1.19.0-dev.20240521-068bb3d5ee, the version of WebAssembly file need to match the JS file.
from onnxruntime.
关于部署 WebAssembly 文件有关。请参考#19831 (评论)。
顺便说一句,在 1.19.0-dev.20240521-068bb3d5ee 版本之前,WebAssembly 的版本需要与 JS 的版本相匹配。
First:
But i have setted :env.wasm.wasmPaths = window.location.origin + "/node_modules/onnxruntime-web/dist/";
I don't understand "The .wasm files are correctly deployed" ,can you tell me about the detail?
Second:
So I just upgarde the onnruntime-web version to 1.19.0-dev.20240521-068bb3d5ee?
from onnxruntime.
env.wasm.wasmPaths = window.location.origin + "/node_modules/onnxruntime-web/dist/";
If you set this in the code, you also need to make sure the file is served by the server. I know that React has "dev" mode and "production" mode, and they may treat asset deployment differently. I am not an expert of React, so I cannot figure out the detail; but the whole idea is to make sure the URL of the .wasm file is actually valid ( which can be verified in your browser devtool, "Network" tab )
from onnxruntime.
env.wasm.wasmPaths = window.location.origin + "/node_modules/onnxruntime-web/dist/";
If you set this in the code, you also need to make sure the file is served by the server. I know that React has "dev" mode and "production" mode, and they may treat asset deployment differently. I am not an expert of React, so I cannot figure out the detail; but the whole idea is to make sure the URL of the .wasm file is actually valid ( which can be verified in your browser devtool, "Network" tab )
Thank you very much!!! I have setted like this:ort.env.wasm.wasmPaths = "https://cdn.jsdelivr.net/npm/[email protected]/dist/"; but it also gives me error. Now, I want to ensure that wheather i need to upgarde the onnxruntime-web
You have 3 options:
- keep using
env.wasm.wasmPaths = window.location.origin + "/node_modules/onnxruntime-web/dist/";
, but you need to make sure the .wasm files are served correctly. For example, if your HTML is athttp://localhost:8080/my/index.html
, you need to make surehttp://localhost:8080/my/node_modules/onnxruntime-web/dist/ort-wasm-simd.wasm
can be accessed. This can be easily validated via browser. Usually the node_modules folder is excluded in dev server so you are unlikely to access that URL. A common way to deploy WASM is to copy the .wasm files into your public folder and setenv.wasm.wasmPaths
to there. - you can use
env.wasm.wasmPaths = "https://cdn.jsdelivr.net/npm/..."
but as I mentioned above, please make sure the version is matched. If you are using version[email protected]
you cannot use wasmPath pointing to version 1.15.0 - You can also upgrade to onnruntime-web version to
1.19.0-dev.20240521-068bb3d5ee
; but you still to choose either serve the .wasm yourself or point path to CDN.
from onnxruntime.
Related Issues (20)
- [Build] moduleNotfoundError: no module named 'onnxruntime.training' & 'No matching distribution found for onnxruntime-training' HOT 7
- Mismatch in results for TensorRT session and cuda Session HOT 3
- [Feature Request] DFT/STFT WebGPU op support (web/js) HOT 2
- [Feature Request] Assess performance capability before a model is loaded HOT 1
- [Feature Request] Error code for terminated Session::run
- [Bug] The accuracy of the A16W16 quantized model is very poor if per_channel is True HOT 3
- ONNXRuntime 1.18 crashing with TensorRT EP when dealing with big inputs HOT 5
- [Mobile] React-native OnnxruntimeJSIHelper install segfaults when registering functions HOT 1
- DML incorrect results, probably Split node HOT 2
- Build onnxruntime with SNPE EP on SA8155P HOT 1
- [E:onnxruntime:, sequential_executor.cc:516 onnxruntime::ExecuteKernel] Non-zero status code returned while running LayerNormalization node. HOT 2
- Run all Nodes on GPU/DML with DML-EP HOT 2
- ImportError: A dynamic link library (DLL) initialization routine failed after building source with Visual Studio 17.10 HOT 8
- [Mobile] onnxruntime-objc crash HOT 4
- v1.17.0 + requires macOS deployment target >= than 13.3 due to C++ 20 HOT 9
- Non-zero status code returned while running ConvTranspose node.
- [Documentation] Install page missing instructions for onnxruntime-rocm HOT 2
- onnxruntime shape mismatch during quantization of yolov8 models HOT 6
- CUDA wasnt able to be loaded when tring to use CUDA12.4 and onnxruntime-gpu 11.8 HOT 2
- Flan-T5 small converted model produces wrong result with batch size > 1 and long senetences
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from onnxruntime.