I want to open a tensorflow model in chrome extension but it doesn't seem to work

Viewed 44

I added the model.json and the bin file at the same directory and allowed web access in the manifest.

However I can't load the file It saids

Error: In local storage, there is no model with name 'model'

But I can find the file in the chrome extension DevTool

This is the code I use

mymodel = {the json model file}
async function load_model() {

    localStorage.setItem("model",JSON.stringify(mymodel));
    const model = await tf.loadLayersModel('localstorage://model');

    return model;
}
0 Answers
Related