-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(components): Added converter components for TensorflowJS LayersM…
…odel (#4527)
- Loading branch information
Showing
2 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
components/_converters/TensorflowJSLayersModel/from_KerasModelHdf5/component.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Convert Keras HDF5 model to Tensorflow JS LayersModel | ||
inputs: | ||
- {name: Model, type: KerasModelHdf5} | ||
outputs: | ||
- {name: Model, type: TensorflowJSLayersModel} | ||
metadata: | ||
annotations: | ||
author: Alexey Volkov <alexey.volkov@ark-kun.com> | ||
implementation: | ||
container: | ||
image: tensorflow/tensorflow:2.3.0 | ||
command: | ||
- sh | ||
- -exc | ||
- | | ||
# Manually installing prerequisites so that tensorflowjs does not re-install tensorflow-cpu on top of tensorflow. See https://github.com/tensorflow/tfjs/issues/3953 | ||
python3 -m pip install --quiet 'h5py>=2.8.0' 'numpy>=1.16.4,<1.19.0' 'six>=1.12.0' 'tensorflow-hub==0.7.0' 'PyInquirer==1.0.3' | ||
python3 -m pip install --quiet tensorflowjs==2.4.0 --no-dependencies | ||
"$0" "$*" | ||
- tensorflowjs_converter | ||
- --input_format=keras | ||
- --output_format=tfjs_layers_model | ||
- inputPath: Model | ||
- outputPath: Model |
24 changes: 24 additions & 0 deletions
24
components/_converters/TensorflowJSLayersModel/from_TensorflowSavedModel/component.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Convert Keras SavedModel to Tensorflow JS LayersModel | ||
inputs: | ||
- {name: Model, type: TensorflowSavedModel} | ||
outputs: | ||
- {name: Model, type: TensorflowJSLayersModel} | ||
metadata: | ||
annotations: | ||
author: Alexey Volkov <alexey.volkov@ark-kun.com> | ||
implementation: | ||
container: | ||
image: tensorflow/tensorflow:2.3.0 | ||
command: | ||
- sh | ||
- -exc | ||
- | | ||
# Manually installing prerequisites so that tensorflowjs does not re-install tensorflow-cpu on top of tensorflow. See https://github.com/tensorflow/tfjs/issues/3953 | ||
python3 -m pip install --quiet 'h5py>=2.8.0' 'numpy>=1.16.4,<1.19.0' 'six>=1.12.0' 'tensorflow-hub==0.7.0' 'PyInquirer==1.0.3' | ||
python3 -m pip install --quiet tensorflowjs==2.4.0 --no-dependencies | ||
"$0" "$*" | ||
- tensorflowjs_converter | ||
- --input_format=keras_saved_model | ||
- --output_format=tfjs_layers_model | ||
- inputPath: Model | ||
- outputPath: Model |