To get help from the community, we encourage using Stack Overflow and the tensorflow.js tag.
I have tested with two versions - 2.0.0 and 1.5.1
Crome - 79.0.3945.88
Firefox - 77.0.1
I have created the model in python and converted using the tfjs converter.
When I am loading the model in the browser using the tfjs, it throws error.
I have check in the model json, that the layer exists with the same name.
I am attaching the model and the weights as well.
model_weights.zip
If you would like to get help from the community, we encourage using Stack Overflow and the tensorflow.js tag.
On the browser side, I just use the following code to load the model.
tf.loadLayersModel(
url).then(model => {
model.summary();
model.save(modelName).then();
});
GitHub issues for this repository are tracked in the tfjs union repository.
Please file your issue there, following the guidance in that issue template.
@PratsBhatt please let us know what error you are getting ?
As the header for the issue suggest - I receive Provided weight data has no target variable: lstm/lstm_cell/kernel
Below is the stacktrace:-
`tf.min.js:2 Uncaught (in promise) Error: Provided weight data has no target variable: lstm/lstm_cell/kernel
at new e (tf.min.js:2)
at e.loadWeights (tf.min.js:2)
at tf.min.js:2
at tf.min.js:2
at Object.next (tf.min.js:2)
at a (tf.min.js:2)
e @ tf.min.js:2
e.loadWeights @ tf.min.js:2
(anonymous) @ tf.min.js:2
(anonymous) @ tf.min.js:2
(anonymous) @ tf.min.js:2
a @ tf.min.js:2
`
I have also attached the model.json and the weights, so that you can recreate the issue.
I receive the error when loading the layers model.
Just as a note: When I use strict = false, the model gets loaded, but i think it should work without strict = false.
Thank you for looking in to the issue.
I'm having the same issue with Chrome 83.0.4103.106. I'm using tensorflow.js Version 2.0.0
Provided weight data has no target variable: lstm/lstm_cell/kernel
Can you please check here for similar issue.
@mbuschtoens @Patrick-David Can you both give it a try with the tensorflowjs pip version 2.0.1 ?
We have recently fixed a similar bug for weight name mismatch between tf 2.2 and tfjs.
@rthadur Yes, I have checked the issue at the mentioned place, tried all the solutions that they have suggested. As I said before Strict: false works, but I don't think that is the solution for this issue.
As I am just confused why does the tensorflowjs does not find the target weights as I can see that declared in the model.json,
@pyu10055 I am not sure, if you intended to tag me. I will give it a try as well.
@rthadur I wll check it out by end of the day today and provide an update here.
Just to be clear, do you mean using tensorflowjs version 2.0.1 that is used for converting the model?
or the tensorflowjs version used at the javascript side while loading the converted model? @pyu10055
Hello @pyu10055 I can confirm that it is working with the latest version 2.0.1.
Thank you for your quick response.
Thank you , closing this issue.
For anyone still running into this, since it wasn't explicitly answered in this thread: The bug fix is in BOTH the python pip tensorflowjs library as well as the JS tensorflow.js files.
Upgrading both to 2.0.1 resolved the issue for me as well.
Most helpful comment
For anyone still running into this, since it wasn't explicitly answered in this thread: The bug fix is in BOTH the python pip tensorflowjs library as well as the JS tensorflow.js files.
Upgrading both to 2.0.1 resolved the issue for me as well.