From c8dc8019cbdf7bfe7853bf8c7c7d71ba698cca7b Mon Sep 17 00:00:00 2001 From: Fabio Carrara Date: Thu, 3 Feb 2022 10:51:49 +0100 Subject: [PATCH] added onnx model conversion --- Dockerfile | 2 +- convert_to_onnx.sh | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 convert_to_onnx.sh diff --git a/Dockerfile b/Dockerfile index bde5a44..513331f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,4 +3,4 @@ FROM tensorflow/tensorflow:2.4.1-gpu-jupyter RUN apt update && apt install -y nvidia-modprobe RUN pip install adabelief-tf pandas imageio imageio-ffmpeg seaborn sklearn tensorflow_addons tqdm RUN pip install keras_applications tensorflowjs - +RUN pip install tf2onnx diff --git a/convert_to_onnx.sh b/convert_to_onnx.sh new file mode 100644 index 0000000..efbc836 --- /dev/null +++ b/convert_to_onnx.sh @@ -0,0 +1,8 @@ +#/bin/bash + +# prerequisite: +# pip install tf2onnx + +RUNDIR="path/to/run/dir" + +python -m tf2onnx.convert --saved-model $RUNDIR/best_savedmodel --output $RUNDIR/best_model.onnx \ No newline at end of file