transcranial / keras-js

Run Keras models in the browser, with GPU support using WebGL
https://transcranial.github.io/keras-js
MIT License
4.96k stars 501 forks source link

keras.js : unable to read binary file #136

Closed hmhwe closed 5 years ago

hmhwe commented 5 years ago

I want to run a POS tagging kera model on a browser using keras.js in react, but it is unable to read the file. Here is the js code

handlePredict()
    {
      const model = new Model({
        filepath:'example.biln',
        filesystem: true,
        gpu: true
      })
      alert('Input');

    model.ready().then(() =>model.predict({
    input: new Float32Array(samples),
    }))
    .then(output =>
      {
      // outputData is an object keyed by names of the output layers
      // or `output` for Sequential models
      // e.g.,
      alert('Predicted value : ' + output[1]);
      })
    .catch(err =>
      {
      alert(err);
      })

    }

What could be the problem?