Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Error: input 'attention_mask' is missing in 'feeds'. #307

Open
kshuraj opened this issue Aug 3, 2021 · 1 comment
Open

Error: input 'attention_mask' is missing in 'feeds'. #307

kshuraj opened this issue Aug 3, 2021 · 1 comment

Comments

@kshuraj
Copy link

kshuraj commented Aug 3, 2021

I would like to know if the Tensor() in onnx.js would support mask token.
I am using the 'bert-base-cased' model to predict the masked text. https://huggingface.co/bert-base-cased

`const onnx = require('onnxjs-node');

async function main() {
const url = "model_output/bert-base-cased.onnx";

const session = new onnx.InferenceSession();
await session.loadModel(url);

// const inputs = [new onnx.Tensor(["I", "<MASK>","to","mars"], "string"), ]  **# I would require help here of how we can provide a input.** 
const inputs = [new onnx.Tensor([])

session.run(inputs)
        .then(
            (data) => {
                console.log("+++++++++++++++ SUCCESS +++++++++++++");
                console.log(data);
                console.log(data.values.next().value);
            }
        )
        .catch(
            (error) => {
                console.log("---------------- ERROR --------------");
                console.log(error);
            }
        );

}

main();
`
Any help would be greatly appreciated.
Thanks in advance.

@fs-eire
Copy link
Contributor

fs-eire commented Sep 10, 2021

Thanks for your feedback!

For running ONNX model inferencing in Node.js, onnxjs-node is replaced by ONNX Runtime Node.js binding. This uses the up-to-date ONNXRuntime backend (v1.8), while onnxjs-node uses ONNXRuntime v1.4

please check it out to see if it resolves the issue.

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

No branches or pull requests

2 participants