From 966cfdd95ff68268eee75b959b59377c592aafcc Mon Sep 17 00:00:00 2001 From: NotBad Date: Sat, 27 Jun 2020 21:53:41 +0800 Subject: [PATCH] add tnn model convertor build to ci --- .github/workflows/main.yml | 13 ++++++++++++- tnn/build_tnn_model_convertor.sh | 25 +++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100755 tnn/build_tnn_model_convertor.sh diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 28d6a77..5c04694 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,20 +26,22 @@ jobs: - name: Run a one-line script run: echo Hello, world! + # Runs a set of commands using the runners shell - name: Run a multi-line script run: | echo Add other actions to build, echo test, and deploy your project. + - name: pre-commit check run: cd .github/workflows && ./pre-commit-job.sh + - name: python unit test run: .github/workflows/unit-test-job.sh - tnn: @@ -49,6 +51,15 @@ jobs: - name: Run tnn build run: cd tnn && ./build.sh + + tnn-model-convertor: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Run tnn model convertor build + run: cd tnn && ./build_tnn_model_convertor.sh + + models: runs-on: ubuntu-latest steps: diff --git a/tnn/build_tnn_model_convertor.sh b/tnn/build_tnn_model_convertor.sh new file mode 100755 index 0000000..00c696f --- /dev/null +++ b/tnn/build_tnn_model_convertor.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +set -ex + +function prepare_env() { + # default + pip3 install onnx==1.6.0 onnxruntime numpy onnx-simplifier + + # optional: tensorflow + pip3 install tensorflow==1.15.0 + pip3 install tf2onnx + pip3 install onnxruntime + + # optional: caffe + sudo apt-get install libprotobuf-dev protobuf-compiler +} + +function main() { + prepare_env + + # build + cd tnn/tools/convert2tnn + ./build.sh +} + +main