tfjs icon indicating copy to clipboard operation
tfjs copied to clipboard

Problem with using converted model in tensorflowjs

Open DHosseiny opened this issue 3 years ago • 4 comments

I want to use a pre-trained model for sentimental analysis. I started from here and I converted the Keras(tf_model.h5) model with tensorflowjs_converter to model.json and other group...shard.bin files. But in this example, there is a metadata file(here is loaded) that I don't know how to get/create. Can you clarify what is this metadata file and how to get/create it in my example? Thanks

DHosseiny avatar Aug 07 '22 15:08 DHosseiny

After researching. it seems like this metadata file is specific to this imdb data set and is not a standard thing TFJS does. If you are following the sentiment analysis example provided by TFJS, the pre-generated metadata file is provided to you by default via remotely hosted URL and is downloaded after running the "yarn train" command. In conclusion, it is up to the model provider/user to generate their own custom metadata.

If i missed some critical information regarding the topic then forgive me.

Unal-Inanli avatar Aug 07 '22 17:08 Unal-Inanli

Thank you. So how to use a converted sentimental analysis model in tfjs? Is there any example?

DHosseiny avatar Aug 08 '22 10:08 DHosseiny

perhaps this is a good place to start, example Its using the model trained on the IMDB dataset with the metadata but its the best example i could find. It's also a good idea to check the attributes of the model you are loading to see if there are any metadata worthy attributes you can use.

Unal-Inanli avatar Aug 08 '22 15:08 Unal-Inanli

Thank you , you can use example for toxicity and try to include the sentimental analysis model , https://glitch.com/~tfjs-learning-toxicity .

rthadur avatar Aug 09 '22 21:08 rthadur

Closing as stale. Please @mention us if this needs more attention.

google-ml-butler[bot] avatar Aug 31 '22 00:08 google-ml-butler[bot]