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

TypeError: layer.layer is undefined #138

Open hmhwe opened 5 years ago

hmhwe commented 5 years ago

I want to run a keras model on a browser using keras.js , but keras.js predict is not working. while loading i got the following error

TypeError: layer.layer is undefined here is the js code:

  const model = new KerasJS.Model(
        {
        filepath: 'example.bin',
        gpu : true,
        filesystem : true

        })

          model.ready().then(() => model.predict(
          {
            input: new Float32Array(samples),
          })) .then(({output}) => 
          {
            alert(output['output']);
          })
          .catch((error) => 
          {
            alert(error);
         });