onnxruntime icon indicating copy to clipboard operation
onnxruntime copied to clipboard

[Bug] [onnxruntime-node] Error: no available backend found. ERR: [wasm] backend not found.

Open kabyanil opened this issue 6 months ago • 3 comments

I am creating an Electron app where I need to run inference on some onnx models through the Node.js backend. I have installed "onnxruntime-node": "^1.19.0" as dependency. I am initializing the models with -

const sessionOptions = {
         executionProviders: ['wasm'],
      }

const session = {
         model_1: await ort.InferenceSession.create("./assets/models/model_1.onnx", sessionOptions),
      }

This throws the following error when I run electron . -

Error: no available backend found. ERR: [wasm] backend not found.
    at resolveBackendAndExecutionProviders (~/my-electron-app/node_modules/onnxruntime-common/dist/cjs/backend-impl.js:124:15)
    at async InferenceSession.create (~/my-electron-app/node_modules/onnxruntime-common/dist/cjs/inference-session-impl.js:183:52)

I am on intel x64 MacOS 12.7.5 with Node.js version 20.16.0.

This issue to very urgent to me, as I am not able to write the inference code without first loading the model.

What is the issue here and how to resolve it?

kabyanil avatar Aug 21 '24 08:08 kabyanil