Releases: patlevin/tfjs-to-tf
TFJS Graph Converter v1.2
Changes
Features
- Graph input and output nodes can now be renamed (using the util module)
- Signature outputs can now be manually selected when saving as
tf_saved_model
. - Signature inputs and -outputs can now be renamed when saving as
tf_saved_model
. - Tags passed to API functions for
SavedModel
export are now optional and don't have have to be lists of strings anymore
CLI
- NEW
--outputs
option to select exported outputs fortf_saved_model
signatures. - NEW
--rename
option to rename exported inputs and outputs fortf_saved_model
signatures. - NEW
--method_name
option to manually override the method name fortf_saved_model
signatures.
API
- NEW api.RenameMap class to specify renamed inputs and outputs in
SavedModel
signatures - UPDATED api.graph_model_to_frozen_graph has a new optional arguments
signature_def_map
andsignature_key_map
to specify model signatures - UPDATED api.graph_models_to_frozen_graph has a new optional arguments
signatures
andsignature_keys
to specify per-model signatures - UPDATED api.graph_model_to_frozen_graph
tags
argument is now optional and doesn't have to be a list of strings anymore - a single string is accepted as well - NEW util.rename_input_nodes function to rename
input nodes inGraphDef
model proto messages - NEW util.rename_output_nodes function to
rename output nodes inGraphDef
model proto messages
Bug Fixes
- util.get_output_nodes and util.get_output_tensors could lead to broken graphs when used
- Tags provided to api.graph_models_to_frozen_graph and api.graph_models_to_frozen_graph are now filtered to remove empty/
None
entries; leading and trailing whitespace characters are stripped from tags
Installation/Upgrade
Using pip:
pip install -U tfjs_graph_converter
Bugfix/Improvement
Bug Fixes
This release fixes an issue (#15) with signature generation if the model doesn't contain signature meta data and uses dynamic tensor dimensions.
Details
Some models (e.g. posenet/resnet50) don't contain signature meta data. In this case, the converter tries to "guess" the correct model signature.
This works by identifying inputs and outputs and selecting the tensor dimensions accordingly. Unfortunately, due to a coding error, unspecified (i.e. dynamic) dimensions where ignored instead of written as "-1" as per TF conventions. This lead to a mismatch in (output-) tensor dimensions.
Another minor issue arose from naming. While models with proper signature meta data used the tensor name (e.g. including channel id) as key, SavedModel signatures usually don't include the channel id. This has been fixed as well, so even if the signature is taken directly from the model itself, any channel ids will be removed.
Compatibility Fix
This release fixes a compatibility issue with the latest versions (v2.2 and v2.3) of tensorflow (see #14).
Bugfix Release
Bugfixes
- Fixed issue #12 - Modules weren't imported by the main package, which led to confusion when importing the package
- Fixed issue #13 - Signatures were missing from models when converting to the SavedModel-format
The following will now work as expected:
import tfjs_graph_importer as tf_conv
model = tf_conv.api.load_graph_model('~/my-models/tfjs/resnet50')
New Functions
- load_graph_model_and_signature has been added to api and can be used to load a
Graph
along with itsSignatureDef
- infer_signature has been added to util and can infer a
SignatureDef
from a givenGraph
orGraphDef
Installation
The update is available on PyPi, so pip --upgrade tfjs_graph_converter
should now install the latest version.
Installation from source works as well by downloading and unpacking the source code and running pip install .
from the source folder.
Bugfix Release
Bug Fixes
- Specifying SavedModel-tags on the command line resulted in tags being broken into individual letters
Big thanks to PapaEcureuil for finding the bug and submitting the fix!
TFJS Graph Converter v1.0
Version 1.0 Release 🎉
This is a big one. First of all, thanks to the feedback I received, this package can now be found on PyPi.
Installing via pip install tfjs-graph-converter
is now possible 👍
Breaking Changes
- package name changed from
tfjs_graph_converter
totfjs-graph-converter
; make sure to usepip uninstall tfjs_graph_converter
before upgrading to this release
Features
- Added support for models that use
PReLU
activation - Added additional graph optimisation (since models may now be rewritten)
- Added complete suite of unit tests covering all public functions
- Updated the documentation to include most modules
- Package now available on PyPi
- Extended API to include functions for wrapping loaded models in TF2 functions
Bug fixes
- Reverted a change that altered the return value of
load_graph_model()
fromtf.Graph
toGraphDef
protocol message, which caused problems for some users - Fixed a bug in node naming that could have lead to failed conversions
TensorflowJS to Tensorflow Converter [Preview]
This release fixes an error with unsupported layers.
Models containing Keras-layers (such as tf.keras.layers.PReLU), which are not supported by the GraphDef version will now show a proper error message that includes the operation name instead of an exception stack trace.
Converting these layers is currently not possible, though.
TensorflowJS to Tensorflow Converter
Feature Release
Added Features
- Model description files (
model.json
) can now be specified directly with the input path
Models aren't always using the name model.json
for their model description files. Up until now, users had to manually rename the model description files to the expected file name.
Starting with this release, you can now specify differing file names for model descriptions directly in the input path:
tfjs_graph_converter /path/to/download/folder/model-stride16.json /path/to/output/tf_model.pb
Models that use the default name model.json
can still be converted by just specifying the folder name:
tfjs_graph_converter /path/to/tfjs/model/ /path/to/output/tf_model.pb
TensorflowJS to Tensorflow Converter
Fixes
- fix Issue #3 : TypeError when converting model
TensorflowJS to Tensorflow Converter
TensorflowJS to Tensorflow Converter
A small Python 3 module for converting TFJS models to TensforFlow frozen graphs and SavedModels.
This is the first update since the initial release and fixes a problem with certain imported models.
Fixes
- fixes #1 unable to load bodypix resnet50 model
- mismatching license text in some source files