Reputation: 121
I 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)
What can I do to fix it . What can be the possible reasons for this error ? Thanks for the help .
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()
Upvotes: 0
Views: 817
Reputation: 2962
As per a comment in https://github.com/tensorflow/tfjs/issues/744, update your tfjs version:
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@tensorflow/[email protected]"></script>
This worked for me.
Upvotes: 1
Reputation: 4465
I'd double check your model.json
. I got this exact same error when I converted just my Keras model weights to Tensorflow.js json format (rather than my entire model). i.e. I was saving my Keras model with model.save_weights(filepath)
rather than model.save()
.
Your problem may not be the same as mine, but it's probably something to do with your actual model rather than anything to do with the loading of said model.
Upvotes: 0