Open yang-junhua opened 8 months ago
Looks like a similar issue to #19829 #19556 #11413. Please refer to https://github.com/microsoft/onnxruntime/issues/19829#issuecomment-1986524595
In short, make sure:
ort.env.wasm.wasmPaths
to override the path of the .wasm filesThis issue has been automatically marked as stale due to inactivity and will be closed in 30 days if no further activity occurs. If further support is needed, please provide an update and/or more details.
Describe the issue
package.json: { "name": "mall", "version": "0.1.0", "private": true, "scripts": { "dev": "vue-cli-service serve --mode dev", "build:test": "vue-cli-service build --mode test", "build:prod": "vue-cli-service build --mode prod", "lint": "vue-cli-service lint" }, "dependencies": { "axios": "^1.6.5", "core-js": "^3.6.5", "element-ui": "^2.15.14", "normalize.css": "^8.0.1", "npyjs": "^0.4.0", "onnxruntime-web": "^1.14.0", "underscore": "^1.13.6", "vue": "^2.6.11", "vue-router": "^3.2.0", "vuex": "^3.4.0" }, "devDependencies": { "@vue/cli-plugin-babel": "~4.5.4", "@vue/cli-plugin-eslint": "~4.5.4", "@vue/cli-plugin-router": "~4.5.4", "@vue/cli-plugin-vuex": "~4.5.4", "@vue/cli-service": "~4.5.4", "@vue/eslint-config-prettier": "^6.0.0", "babel-eslint": "^10.1.0", "babel-plugin-component": "^1.1.1", "compression-webpack-plugin": "^6.1.1", "copy-webpack-plugin": "^5.1.2", "eslint": "^6.7.2", "eslint-plugin-prettier": "^3.3.1", "eslint-plugin-vue": "^6.2.2", "friendly-errors-webpack-plugin": "^1.7.0", "html-webpack-plugin": "^4.5.2", "image-webpack-loader": "^7.0.1", "prettier": "^2.2.1", "process": "^0.11.10", "sass": "^1.26.5", "sass-loader": "^8.0.2", "script-ext-html-webpack-plugin": "^2.1.5", "uglifyjs-webpack-plugin": "^2.2.0", "vue-template-compiler": "^2.6.11" } }
vue.config.js:
const UglifyJsPlugin = require("uglifyjs-webpack-plugin"); const CompressionWebpackPlugin = require("compression-webpack-plugin"); const CopyPlugin = require("copy-webpack-plugin"); const FriendlyErrorsWebpackPlugin = require("friendly-errors-webpack-plugin"); const productionGzipExtensions = ["js", "css", "html", "ttf", "eot", "woff"]; const path = require("path"); const webpack = require("webpack"); function resolve(dir) { return path.join(__dirname, dir); } module.exports = { publicPath: "/", outputDir: "dist", assetsDir: "static", lintOnSave: process.env.NODE_ENV === "development", productionSourceMap: false, devServer: { hot: true, // enable HMR on the server open: true, // These headers enable the cross origin isolation state // needed to enable use of SharedArrayBuffer for ONNX // multithreading. headers: { "Cross-Origin-Opener-Policy": "same-origin", "Cross-Origin-Embedder-Policy": "credentialless", }, }, configureWebpack: (config) => {
}, chainWebpack: (config) => { config.plugin("preload").tap(() => [ { rel: "preload", // to ignore runtime.js // https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/cli-service/lib/config/app.js#L171 fileBlacklist: [/.map$/, /hot-update.js$/, /runtime..*.js$/], include: "initial", }, ]);
}, css: { loaderOptions: { scss: { prependData:
@import "@/styles/variables.scss";
, }, }, }, };To reproduce
async initModel() { try { if (MODEL_DIR === undefined) return; const URL = MODEL_DIR; const model = await InferenceSession.create(URL); this.setModel(model); } catch (e) { console.log(e); } },
Urgency
urgency
ONNX Runtime Installation
Released Package
ONNX Runtime Version or Commit ID
1.14.0
Execution Provider
'wasm'/'cpu' (WebAssembly CPU)