Skip to content

TFJS Graph Converter v1.4.2

Compare
Choose a tag to compare
@patlevin patlevin released this 03 Dec 14:16
· 41 commits to master since this release

Minor Patch Release

Changes

Users reported errors when trying to convert Keras models (#27, #28).
This patch addresses these issues by checking the model format prior to parsing and converting it.
If the detected format differs from the expected TFJS graph model format, a (hopefully) more helpful error message is displayed instead of a stack trace, e.g.:

> tfjs_graph_converter keras-model.json /home/user/models/ --output_format=tf_saved_model
> TensorFlow.js Graph Model Converter

Graph model:    keras-model.json
Output:         /home/user/models/
Target format:  tf_saved_model

Converting.... Error: The model is a KERAS layers-model.
This converter only handles GRAPH models.
You can load and convert Keras models directly (using Python):

        import tensorflowjs as tfjs

        model = tfjs.converters.load_keras_model("keras-model.json")
        model.save("/home/user/models")
>

Installation

Via pypi: pip install -U tfjs-graph-converter

From source directory: pip install .