The tf.loadModel() does not works for tensorflow keras models
See original GitHub issueI am using tensorflow js to load a model from keras following This Guideline However on this line of code
const model = await tf.loadModel('https://foo.bar/tfjs_artifacts/model.json');
I am getting the error
Error: Sequential.fromConfig called without an array of configs at new t (app.js:26972) at t.fromConfig (app.js:26972) at deserializeKerasObject (app.js:26972) at deserialize (app.js:26972) at app.js:26972 at app.js:26972 at Object.next (app.js:26972) at o (app.js:26972) I think this happens only with keras model .
Note:I have enabled cors in my server so I don’t think its a problem related to my server . I am using a localhost(Not the one mentioned in guideline) Also as mentioned in the docs I have used
tfjs.keras.converters.save_keras_model() in the python side
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:16 (1 by maintainers)
Top GitHub Comments
Just want to point out here that although tensorflow/tfjs-layers#332 now allows reading the new format produced by TF 1.11 (Sequential config is a dict containing a ‘layers’ array), we are still writing the old format (Sequential config is itself the layers array).
At some point we should consider whether Sequential.getConfig() should also write the new format (ideally as part of a clear version compatibility story).
Ok! Posted on the group: https://groups.google.com/a/tensorflow.org/forum/#!topic/tfjs/FxyXLBJAwvU