Skip to content

Instantly share code, notes, and snippets.

@duhaime
Created January 24, 2019 21:28
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 duhaime/f7d1b2aa250317de637991c8e5feb882 to your computer and use it in GitHub Desktop.
Save duhaime/f7d1b2aa250317de637991c8e5feb882 to your computer and use it in GitHub Desktop.
Save Keras model for tensorflow.js
# given a model named `decoder`
decoder.save('mnist-decoder.hdf5')
# run `pip install tensorflowjs` for the tensorflowjs_converter command
cmd = 'tensorflowjs_converter --input_format keras \
mnist-decoder.hdf5 \
mnist-decoder-js'
os.system(cmd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment