Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with finding onnxruntime_binding.node on Windows 10 on a bootcamp Macbook #18971

Open
samlhuillier opened this issue Jan 1, 2024 · 5 comments
Labels
api:Javascript issues related to the Javascript API platform:web issues related to ONNX Runtime web; typically submitted using template platform:windows issues related to the Windows platform

Comments

@samlhuillier
Copy link

Describe the issue

When I try to run some basic onnxruntime code in a basic node 18 project on Windows 10 bootcamp on a macbook , I get the following error:

App threw an error during load
Error: The specified module could not be found.
\\?\C:\Users\samto\Desktop\reor\node_modules\onnxruntime-node\bin\napi-v3\win32\x64\onnxruntime_binding.node
    at process.func [as dlopen] (node:electron/js2c/asar_bundle:2:2238)
    at Module._extensions..node (node:internal/modules/cjs/loader:1356:18)
    at Object.func [as .node] (node:electron/js2c/asar_bundle:2:2238)
    at Module.load (node:internal/modules/cjs/loader:1126:32)
    at Module._load (node:internal/modules/cjs/loader:967:12)
    at l._load (node:electron/js2c/asar_bundle:2:13642)
    at Module.require (node:internal/modules/cjs/loader:1150:19)
    at require (node:internal/modules/cjs/helpers:119:18)
    at Object.<anonymous> (C:\Users\samto\Desktop\reor\node_modules\onnxruntime-node\dist\binding.js:9:1)
    at Module._compile (node:internal/modules/cjs/loader:1271:14)

To reproduce

Create a basic node 18 project on windows 10 bootcamp machine from a macbook. And try running the following code:

const ort = require("onnxruntime-node");

async function main() {
  try {
    // Load the ONNX model (make sure to provide the correct path to your model)
    const session = await ort.InferenceSession.create(
      "C:UserssamtoDownloadssqueezenet1.0-7.onnx"
    );

    // Create a tensor for input (adjust the size and data according to your model's requirements)
    // Example: Creating a dummy input tensor
    const inputTensor = new ort.Tensor(
      "float32",
      new Float32Array(1 * 3 * 224 * 224),
      [1, 3, 224, 224]
    );

    // Run the model with the tensor (replace 'inputName' with your model's actual input name)
    const feeds = { inputName: inputTensor };
    const results = await session.run(feeds);

    // Process the output (replace 'outputName' with your model's actual output name)
    const outputTensor = results.outputName;
    console.log(`Model output: ${outputTensor.data}`);
  } catch (error) {
    console.error("Error during ONNX session:", error);
  }
}

main();

Urgency

No response

Platform

Windows

OS Version

10

ONNX Runtime Installation

Released Package

ONNX Runtime Version or Commit ID

1.16.3

ONNX Runtime API

JavaScript

Architecture

X64

Execution Provider

Default CPU

Execution Provider Library Version

No response

@github-actions github-actions bot added api:Javascript issues related to the Javascript API platform:web issues related to ONNX Runtime web; typically submitted using template platform:windows issues related to the Windows platform labels Jan 1, 2024
@wschin
Copy link
Contributor

wschin commented Jan 3, 2024

npm install onnxruntime-node if your machine doesn't have it.

@samlhuillier
Copy link
Author

Yes I do do that. The above error occurs after doing the npm install you mention...

@maani7823
Copy link

Hi @samlhuillier you need to install this
https://aka.ms/vs/17/release/vc_redist.x64.exe

onnxruntime-node require you to have MSVS C++ redist

@A5an
Copy link

A5an commented May 9, 2024

Hi @samlhuillier you need to install this https://aka.ms/vs/17/release/vc_redist.x64.exe

onnxruntime-node require you to have MSVS C++ redist

does that will work on the deployed server after that? Like, should I install or configure something on the vercel, to make sure that onnxruntime-node would work?

@conficiusa
Copy link

Hi @samlhuillier you need to install this https://aka.ms/vs/17/release/vc_redist.x64.exe
onnxruntime-node require you to have MSVS C++ redist

does that will work on the deployed server after that? Like, should I install or configure something on the vercel, to make sure that onnxruntime-node would work?

did you figure out how to configure vercel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api:Javascript issues related to the Javascript API platform:web issues related to ONNX Runtime web; typically submitted using template platform:windows issues related to the Windows platform
Projects
None yet
Development

No branches or pull requests

5 participants