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 503 forks source link

keras.js unable to load binary file #135

Closed hmhwe closed 5 years ago

hmhwe commented 5 years ago

I want to run a POS tagging keras model on a browser using keras.js , but keras.js is not loading the binary file

here is the js code

handlePredict()
    {
      this.model = new KerasJS.Model({
        filepath:'examlple.bin',
        filesystem: true,
        gpu: false
      })
      alert('Input');

     this.model.ready().then(() =>this.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);
      })
    .catch(err =>
      {
      alert(err);
      })

    }

I have tried with keras 2.2.4 and 2.2.2. Any help would be appreciated.