Skip to content

Instantly share code, notes, and snippets.

@xsqian
Last active September 15, 2021 18:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xsqian/fb5b20bdfc517237f0a97322be80a2e0 to your computer and use it in GitHub Desktop.
Save xsqian/fb5b20bdfc517237f0a97322be80a2e0 to your computer and use it in GitHub Desktop.
How to export a .h5 model to jaon
# install
pip install tensorflowjs
# convert h5 model to json
tensorflowjs_converter --input_format=keras model_3.h5 model_3.json
# view the model in json format:
python -m json.tool model.json
# note: jq need os access to install, not just a pip install,
# https://stedolan.github.io/jq/download/
#on linux
sudo apt-get install jq
# on mac
brew install jq
jq --color-output . model.json | less -R
cat model.json | jq .
kubectl get node -o json | jq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment