Comments (5)
Than you for reporting this issue. I will try to figure out how to fix this problem.
from onnxruntime.
So it turns out to be that dynamic import (ie. import()
) and top-level await
is not supported in current service worker. I was not expecting that import()
is banned in SW.
Currently, the WebAssembly factory (wasm-factory.ts) uses dynamic import to load the JS glue. This does not work in service worker. A few potential solutions are also not available:
- Modifying it to import statement: won't work, because the JS glue includes top-level
await
. - Using
importScripts
: won't work, because the JS glue is ESM - Using
eval
: won't work; same toimportScripts
I am now trying to make a JS bundle that does not use dynamic import for usage of service worker specifically. Still working on it
from onnxruntime.
Thanks, I appreciate your efforts around this. It does seem like some special-case bundle will need to be built after all; you might need iife
or umd
for the bundler output format
from onnxruntime.
Thanks, I appreciate your efforts around this. It does seem like some special-case bundle will need to be built after all; you might need
iife
orumd
for the bundler output format
I have considered this option. However, Emscripten does not offer an option to output both UMD(IIFE+CJS) & ESM for JS glue (emscripten-core/emscripten#21899). I have to choose either. I choose the ES6 format output for the JS glue, because of a couple of problems when import UMD from ESM, and import()
is a standard way to import ESM from both ESM and UMD. ( Until I know its not working in service worker by this issue)
I found a way to make ORT web working, - yes this need the build script to do some special handling. And this will only work for ESM, because the JS glue is ESM and it seems no way to import ESM from UMD in service worker.
from onnxruntime.
Related Issues (20)
- Error in quantize vicuna-7b model from fp16 to int8 HOT 4
- Issue of UNet Model Inference with [model.onnx + model.onnx_data] in ONNX Runtime C++ for Stable Diffusion HOT 9
- Gemm fp8 run error HOT 3
- Where is onnxruntime-openvino==1.18.0 HOT 3
- [.NET] Update tensor implementations to new Tensor<T> type
- ONNXruntime version 1.18.0 HOT 6
- Could onnxruntime add VSINPU execution provider? HOT 2
- [Bug] The quantized weight type will be overridden by the activation type if per_channel is True HOT 3
- Java CreateTensor with NIO ByteBuffer for reuse purpose HOT 2
- [Training] Compiling ONNX Runtime for MIPS32 Linux for On-Device Training Capabilities HOT 1
- [Build] CUDA Illegal Memory Access error when using a custom Triton kernel HOT 1
- [Build] how to buid on openharmony? HOT 1
- OpenCL and Mali GPU support left out of all execution providers
- [Feature Request] Offline optimization for CoreML
- How to output the middle layer in ONNXRUNTIME for C++? HOT 4
- XGBoost converter output size shape warning and multiclass prediction error HOT 1
- [Feature Request] Move graph compilation behind higher transformers (graph optimization) HOT 1
- Microsoft.ML.OnnxRuntime.Gpu 1.18.0 not working with NVIDIA CUDA 11.6 HOT 9
- [Build] Fail to build onnxruntime on Nvidia Jetson Xavier with Jetpack 4.6 (rev3) HOT 3
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.