From 60be55b8d98ecb90de837bfbf611bd85eff383e1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EC=9D=B4=EC=84=B1=EC=9E=AC/On-Device=20Lab=28SR=29/Princip?= =?utf8?q?al=20Engineer/=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Tue, 26 Nov 2019 14:31:38 +0900 Subject: [PATCH] Improved checking of running environments. (#9197) - Check if `$flatc` path is executable. - Check if `*.fbs` files actually exists. Signed-off-by: Sung-Jae Lee --- tools/nnpackage_tool/tflite2circle/tflite2circle.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/nnpackage_tool/tflite2circle/tflite2circle.sh b/tools/nnpackage_tool/tflite2circle/tflite2circle.sh index 85b77cc..6ad2ef9 100755 --- a/tools/nnpackage_tool/tflite2circle/tflite2circle.sh +++ b/tools/nnpackage_tool/tflite2circle/tflite2circle.sh @@ -10,6 +10,16 @@ flatc=${flatc:-"$nnfw_root/build/externals/FLATBUFFERS/build/flatc"} tflite_schema=${tflite_schema:-"$nnfw_root/externals/TENSORFLOW-1.12/tensorflow/contrib/lite/schema/schema.fbs"} circle_schema=${circle_schema:-"$nnfw_root/nnpackage/schema/circle_schema.fbs"} +if ! [ -x "$flatc" ]; then + echo "Please make sure `flatc` is in path." + exit 2 +fi + +if ! { [ -e "$tflite_schema" ] && [ -e "$circle_schema" ]; }; then + echo "Please make sure that the `*.fbs` paths are set properly." + exit 3 +fi + usage() { echo "Usage: $progname [options] tflite" echo "Convert tflite to circle" -- 2.7.4