-
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 converters to OnnxModel from Tensorflow and K…
…eras (#4550)
- 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/OnnxModel/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: To ONNX from Keras HDF5 model | ||
inputs: | ||
- {name: Model, type: KerasModelHdf5} | ||
outputs: | ||
- {name: Model, type: OnnxModel} | ||
metadata: | ||
annotations: | ||
author: Alexey Volkov <alexey.volkov@ark-kun.com> | ||
implementation: | ||
container: | ||
image: tensorflow/tensorflow:2.3.0 | ||
command: | ||
- sh | ||
- -exc | ||
- python3 -m pip install tf2onnx==1.6.3 && "$0" "$@" | ||
- python3 | ||
- -m | ||
- tf2onnx.convert | ||
- --keras | ||
- {inputPath: Model} | ||
- --output | ||
- {outputPath: Model} | ||
- --fold_const | ||
- --verbose |
24 changes: 24 additions & 0 deletions
24
components/_converters/OnnxModel/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: To ONNX from Tensorflow SavedModel | ||
inputs: | ||
- {name: Model, type: TensorflowSavedModel} | ||
outputs: | ||
- {name: Model, type: OnnxModel} | ||
metadata: | ||
annotations: | ||
author: Alexey Volkov <alexey.volkov@ark-kun.com> | ||
implementation: | ||
container: | ||
image: tensorflow/tensorflow:2.3.0 | ||
command: | ||
- sh | ||
- -exc | ||
- python3 -m pip install tf2onnx==1.6.3 && "$0" "$@" | ||
- python3 | ||
- -m | ||
- tf2onnx.convert | ||
- --saved-model | ||
- {inputPath: Model} | ||
- --output | ||
- {outputPath: Model} | ||
- --fold_const | ||
- --verbose |