How to load onnx model in nodejs

hello everyone:
I trained an onnx model and now I want to load it into OpenCV. I use the method of loading the. T7 model in the opencvjs tutorial to generate an error. How can I modify the code.

for which purpose ?
(different goal might need different processing)

how so, exactly (please show code !)
what is the error, and why do you want to modify that function ?

I am a web worker who is quite familiar with Nodejs. I found that there are cases in the Opencvjs tutorial and used them. Now my normal seems to be cv.FS_ The problem with the createDataFile function is that it has 6 parameters (parent, name, URL, canWrite, canRead, canOwn), which seems to be a problem with the relationship between parent and name. My reference path for the. t7 model is parent=“/”, name="/ Model. t7 “, no problem, but my onnx was originally given parent=”/“name=”./xx/model. onnx ", and I received the following error

Err [<generic error, no stack>]{

Node: undefined,

SetErrno: [Function (anonymous)],

Errno: 44,

Message: ‘FS error’

}

Just now I took out the onnx model from the xx directory, and there was no error reported by parent=“/” name=“./model. onnx”. Everything is running normally, and I don’t know why. I also encountered a promise error when uploading the onnx model in the tutorial. The speed of using dnn to style images in nodejs is still a bit slow.

const loadModel = () => {
  // let cvModel = fs.readFileSync(path);

  // cv.FS_createDataFile('/', path, cvModel, true, false, false);

  let cvModel2 = fs.readFileSync("./water2.onnx");
  try {
    cv.FS_createDataFile("/","./water2.onnx",cvModel2,true,true,true)
  } catch (error) {
    if(error){
      console.log("err",error);
    }
  }

  return path
}