I am new to machine learning and I was following this blog on how to write a model with mobilenet.
I managed to convert the .h5 file model and tried to implement it on my web app.
Unfortunately, when I try to load the JSON model I get this error:
Uncaught (in promise) Error: Provided weight data has no target variable: block1_conv1_2/kernel.
Screenshot of the error on a browser
I converted the .h5 model in the command line like so:
tensorflowjs_converter --input_format keras model.h5 ConvertedModel/
The code to load the model in the browser, I followed this blog
let model;
async function loadModel(name) {
$(".progress-bar").show();
model = undefined;
model = await tf.loadModel(`ConvertedModel/model.json`);
$(".progress-bar").hide();
}
To see the code of the model please refer to the blog link. But below is a screenshot of how the model is compiled. Model compilation
Dependencies:
- Tensorflow 1.13.1
- Python 3.6.0
- tensorflowjs 1.0.1
Any help to fix this would be appreciated. Thank you so much.