vzhou842 / easy-VQA-keras

A Keras implementation of VQA using the easy-VQA dataset.
https://easy-vqa-demo.victorzhou.com/
MIT License
22 stars 7 forks source link

Converting model.h5 to model.json #1

Closed Branislava closed 4 years ago

Branislava commented 4 years ago

Thank you both for the great code and documentation! I am starting to learn about VQA and I chose this repository as the most convenient to start with.

I was playing around with train.py. Since the resulting file is only model.h5, I tried to convert this model.h5 to json afterwards.

When I try

tensorflowjs_converter --input_format=keras model.h5 tfjs_model

this says

ModuleNotFoundError: No module named 'tensorflow.compat.v2'

Since I did not manage to fix this after many attempts, I wanted to ask you if there is some other way to convert h5 to json so that it is recognised by your easy-VQA-demo ?

I tried dumping json immediately in train.py (after invoking fit function), but the resulting json had fewer lines and was not recognised by easy-VQA-demo. I also tried with h5-to-json module, but the resulting json had around 20MB (and the one that was in easy-VQA-demo/public/model.json had around 9kB only).

May I ask you for your help on this one?

Many thanks and keep up the great work!

Branislava commented 4 years ago

tensorflowjs had to be 1.4.0, keras 2.3.0