Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert a saved .h5 file to a JSON file

I used a pre-made model with Keras for training a data-set about URLs. results are saved in a .h5 format and I am wondering if I could convert that saved .h5 file to JSON so that I could see the results and apply the JSON file in my system that separates bad URLs from good URLs. I also want to avoid re-training again if possible.

like image 336
Alexander Wazowski Avatar asked Mar 21 '19 23:03

Alexander Wazowski


Video Answer


1 Answers

As mentioned in https://www.tensorflow.org/js/guide/conversion

For example, let’s say you have saved a Keras model named model.h5 to your tmp/ directory. To convert your model using the TensorFlow.js converter, you can run the following command:

tensorflowjs_converter --input_format=keras /tmp/model.h5 /tmp/tfjs_model
like image 54
Arun P Avatar answered Sep 29 '22 21:09

Arun P