You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to train using onnxruntime-web on NodeJS but no wasm backend seems to work.
note: why not onnxruntime-node you ask? I want to run on both web and node, which based on the readme, should be supported; it's also why I'm using ESM instead of CommonJS.
sadly, I wasn't able to find a single version that works. and it isn't really clear which path should be imported. here goes a table of the error when trying to create a TrainingSession.
onnxruntime-web version
import path
error
1.17, 1.18
failed to asynchronously prepare wasm: LinkError: WebAssembly.instantiate(): Import #46 module="a" function="a": memory import must be a WebAssembly.Memory object
1.17, 1.18
/training
Error: no available backend found. ERR: [wasm] ReferenceError: __dirname is not defined, [cpu] Error: previous call to 'initWasm()' failed. (loaded via ESM where __dirname doesn't exists)
1.19, 1.20, dev
Error: Training backend could not be resolved. Make sure you're using the correct configuration & WebAssembly files.
1.19, 1.20, dev
/training
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './training' is not defined by "exports" in [...]/node_modules/onnxruntime-web/package.json imported from [...]/[eval1]
also, 1.20 doesn't ship ort-training-wasm-simd-threaded.{wasm,mjs} anymore, which seems to be intended as per the release ("All ONNX Runtime Training packages have been deprecated"). but I don't see a web package with training in the new pkgs.
To reproduce
#!/bin/sh -eureadonly VERSION=dev
readonly IMPORT=onnxruntime-web
npm init --yes
npm pkg set type=module
npm install "onnxruntime-web@${VERSION}"
node --experimental-default-type=module <<-EOFimport * as ort from "${IMPORT}";await ort.TrainingSession.create({});EOF
Urgency
that does block the ONNX support I wanted to provide in addition to TFJS. so bothering but not vital.
ONNX Runtime Installation
Released Package
ONNX Runtime Version or Commit ID
1.20, dev
Execution Provider
'wasm'/'cpu' (WebAssembly CPU)
The text was updated successfully, but these errors were encountered:
Describe the issue
I'm trying to train using
onnxruntime-web
on NodeJS but no wasm backend seems to work.note: why not
onnxruntime-node
you ask? I want to run on both web and node, which based on the readme, should be supported; it's also why I'm using ESM instead of CommonJS.sadly, I wasn't able to find a single version that works. and it isn't really clear which path should be imported. here goes a table of the error when trying to create a
TrainingSession
.onnxruntime-web
versionfailed to asynchronously prepare wasm: LinkError: WebAssembly.instantiate(): Import #46 module="a" function="a": memory import must be a WebAssembly.Memory object
/training
Error: no available backend found. ERR: [wasm] ReferenceError: __dirname is not defined, [cpu] Error: previous call to 'initWasm()' failed.
(loaded via ESM where__dirname
doesn't exists)Error: Training backend could not be resolved. Make sure you're using the correct configuration & WebAssembly files.
/training
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './training' is not defined by "exports" in [...]/node_modules/onnxruntime-web/package.json imported from [...]/[eval1]
also, 1.20 doesn't ship
ort-training-wasm-simd-threaded.{wasm,mjs}
anymore, which seems to be intended as per the release ("All ONNX Runtime Training packages have been deprecated"). but I don't see a web package with training in the new pkgs.To reproduce
Urgency
that does block the ONNX support I wanted to provide in addition to TFJS. so bothering but not vital.
ONNX Runtime Installation
Released Package
ONNX Runtime Version or Commit ID
1.20, dev
Execution Provider
'wasm'/'cpu' (WebAssembly CPU)
The text was updated successfully, but these errors were encountered: