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

Model rename and Model load issue #6

Open
technic404 opened this issue Nov 1, 2023 · 1 comment
Open

Model rename and Model load issue #6

technic404 opened this issue Nov 1, 2023 · 1 comment

Comments

@technic404
Copy link

When firstly executed node index.mjs with the sample code for node.js, provided error occurs:

node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

[Error: ENOENT: no such file or directory, rename 'F:\Programming\.cache\aislamov\stable-diffusion-2-1-base-onnx\model_index.json.tmp' -> ''F:\Programming\.cache\aislamov\stable-diffusion-2-1-base-onnx\model_index.json'] {                                                -> 
  errno: -4058,
  code: 'ENOENT',
  syscall: 'rename',
  path: ''F:\Programming\\.cache\\aislamov\\stable-diffusion-2-1-base-onnx\\model_index.json.tmp',
  dest: ''F:\Programming\\.cache\\aislamov\\stable-diffusion-2-1-base-onnx\\model_index.json'
}

When I run that secondly, another error occurs:

Downloading model_index.json | ████████████████████████████████████████ | 100% | 587 Bytes/587 Bytes
undefined:1


SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at getModelJSON (file:///F:/Programming/node_modules/@aislamov/diffusers.js/dist/index-node.esm.js:109:15)
    at async DiffusionPipeline.fromPretrained (file:///F:/Programming/node_modules/@aislamov/diffusers.js/dist/index-node.esm.js:1178:19)

Node.js v18.15.0

I think here is similar error to that first one - model_index.json.tmp should be renamed to model_index.json, so then the Unexpected end of JSON input won't occur anymore.

Last error i got is:

F:\Programming\node_modules\onnxruntime-node\dist\backend.js:24
            __classPrivateFieldGet(this, _OnnxruntimeSessionHandler_inferenceSession, "f").loadModel(pathOrBuffer, options);
                                                                                           ^

Error: Failed to find kernel for BiasSplitGelu(1) (node BiasSplitGelu_0). Kernel not found
    at new OnnxruntimeSessionHandler (F:\Programming\node_modules\onnxruntime-node\dist\backend.js:24:92)
    at F:\Programming\node_modules\onnxruntime-node\dist\backend.js:64:29
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11)

Node.js v18.15.0
@dakenf
Copy link
Owner

dakenf commented Nov 2, 2023

Thanks for the feedback, i will fix the rename issue in the next release. As you use node.js with CPU, you need to add --rev cpu to command line when running node example. That way it will download a special model version without GPU-specific optimizations

CUDA/DML providers for node.js are not yet released by ONNX team (my PR for that was already merged microsoft/onnxruntime#16050 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants