TFJS Graph Converter v1.6.0
Feature Release
This release addresses Issue #36 and allows generating more compatible converted models.
The change includes a slight update of the API. The compat_mode
argument has been
changed from a bool to a CompatMode
-enum.
This allows for future compatibility modes without changing function signatures.
The update is available on pypi and can
be installed via pip install tfjs-graph-converter==1.6.0
API Changes
The CompatMode
enumeration can be used to control the operations included in converted
models. It replaces the compat_mode
Boolean switch used in the following functions:
load_graph_model_and_signature(..., compat_mode: CompatMode = CompatMode.NONE)
load_graph_model(..., compat_mode: CompatMode = CompatMode.NONE)
graph_model_to_frozen_graph(..., compat_mode: CompatMode = CompatMode.NONE)
graph_model_to_saved_model(..., compat_mode: CompatMode = CompatMode.NONE)
graph_models_to_saved_model(..., compat_mode: CompatMode = CompatMode.NONE)
New Compatibility Modes
The CompatMode
enumeration currently features the following members:
CompatMode.NONE
: the default; uses all supported native TF operations (including fused operations)CompatMode.TFJS
: harmonises weight types for compatibility with older TFJS versionsCompatMode.TFLITE
: limits model operations to those natively supported by TFLite
Changed Command Line Options
The --compat_mode
switch has changed to require a mode option. The following options are supported:
none
: the default; usesCompatMode.NONE
for convertingtfjs
: useCompatMode.TFJS
for convertingtflite
: useCompatMode.TFLITE
for converting
Notes
Existing programs that don't use the compat_mode
argument don't require any changes.
Programs using the compat_mode=True
need to be updated to use CompatMode.TFJS
instead.
Many thanks to jvuillaumier for making me aware of the issue
and for the kind words.