Uncaught (in promise) Error: no available backend found. ERR:
at t.resolveBackend (backend-impl.js:91:11)
at async i.create (inference-session-impl.js:175:15)
at async createSAM (SAM.ts:59:19)
at async init (http://localhost:5001/src/routes/(app)/app/project/[projectId]/auto-detect/+page.svelte?t=1695723086870:936:9)
In the console I see this:
Error: Not found: /app/project/MpUQMHCfHANBXyvH/ort-wasm-simd.wasm
This is the only place where I'm specifying a path:
const session = await InferenceSession.create('/sam_onnx_quantized.onnx')
Changing it to an absolute path with
http://localhost:5001/sam_... didn't make a difference.
I have this file both in my /static folder, and in node_modules/onnx-runtime-web/dist. It should not be looking for the file in the current page's path.
I don't know what happened, this used to work. I had to delete node_modules and package-lock and do
npm install for a different issue, maybe it broke after that.
You can set the basepath for onnx-web wasm files using the wasmPath property on the ONNX env object like this:
env.wasm.wasmPaths = path/to/wasm/files
This feature is documented in the API Docs