25 lines
906 B
YAML
25 lines
906 B
YAML
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
|