From 20b11e6ccb9ca9e4b8a33d473238d514da29869c Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 13 Aug 2020 12:07:12 +0800 Subject: [PATCH] mod sh --- mindspore/lite/test/run_benchmark_nets.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/mindspore/lite/test/run_benchmark_nets.sh b/mindspore/lite/test/run_benchmark_nets.sh index fd9621302..030b262e9 100644 --- a/mindspore/lite/test/run_benchmark_nets.sh +++ b/mindspore/lite/test/run_benchmark_nets.sh @@ -7,7 +7,7 @@ function Run_x86() { model_name=${line} echo ${model_name} echo 'cd '${convertor_path}'/MSLite-*-linux_x86_64' - cd ${convertor_path}/MSLite-*-linux_x86_64 + cd ${convertor_path}/MSLite-*-linux_x86_64 || return 1 echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./lib;./benchmark/benchmark --modelPath='${ms_models_path}'/'${model_name}'.ms --inDataPath=/home/workspace/mindspore_dataset/mslite/models/hiai/input_output/input/'${model_name}'.ms.bin --calibDataPath=/home/workspace/mindspore_dataset/mslite/models/hiai/input_output/output/'${model_name}'.ms.out --warmUpLoopCount=1 --loopCount=1' || return 1 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./lib;./benchmark/benchmark --modelPath=${ms_models_path}/${model_name}.ms --inDataPath=/home/workspace/mindspore_dataset/mslite/models/hiai/input_output/input/${model_name}.ms.bin --calibDataPath=/home/workspace/mindspore_dataset/mslite/models/hiai/input_output/output/${model_name}.ms.out --warmUpLoopCount=1 --loopCount=1 if [ $? = 0 ]; then @@ -25,7 +25,7 @@ function Run_x86() { model_name=${line} echo ${model_name} echo 'cd '${convertor_path}'/MSLite-*-linux_x86_64' - cd ${convertor_path}/MSLite-*-linux_x86_64 + cd ${convertor_path}/MSLite-*-linux_x86_64 || return 1 echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./lib;./benchmark/benchmark --modelPath='${ms_models_path}'/'${model_name}'.ms --inDataPath=/home/workspace/mindspore_dataset/mslite/models/hiai/input_output/input/'${model_name}'.ms.bin --calibDataPath=/home/workspace/mindspore_dataset/mslite/models/hiai/input_output/output/'${model_name}'.ms.out --warmUpLoopCount=1 --loopCount=1' || return 1 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./lib;./benchmark/benchmark --modelPath=${ms_models_path}/${model_name}.ms --inDataPath=/home/workspace/mindspore_dataset/mslite/models/hiai/input_output/input/${model_name}.ms.bin --calibDataPath=/home/workspace/mindspore_dataset/mslite/models/hiai/input_output/output/${model_name}.ms.out --warmUpLoopCount=1 --loopCount=1 if [ $? = 0 ]; then @@ -124,18 +124,18 @@ while getopts "a:c:m:d:" opt; do done # Unzip arm -cd ${arm_path} +cd ${arm_path} || exit 1 tar -zxf MSLite-*-linux_arm64.tar.gz || exit 1 # Unzip convertor -cd ${convertor_path} +cd ${convertor_path} || exit 1 tar -zxf MSLite-*-linux_x86_64.tar.gz || exit 1 -cd ${convertor_path}/MSLite-*-linux_x86_64 +cd ${convertor_path}/MSLite-*-linux_x86_64 || exit 1 cp converter/converter_lite ./ || exit 1 export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:./lib/:./third_party/protobuf/lib # Convert the models -cd ${convertor_path}/MSLite-*-linux_x86_64 +cd ${convertor_path}/MSLite-*-linux_x86_64 || exit 1 # Set models config filepath models_tflite_config=${basepath}/models_tflite.cfg @@ -167,7 +167,7 @@ done < ${models_caffe_config} rm -rf ${basepath}/benchmark_test mkdir -p ${basepath}/benchmark_test benchmark_test_path=${basepath}/benchmark_test -cd ${benchmark_test_path} +cd ${benchmark_test_path} || exit 1 cp -a ${arm_path}/MSLite-*-linux_arm64/lib/libmindspore-lite.so ${benchmark_test_path}/libmindspore-lite.so || exit 1 cp -a ${arm_path}/MSLite-*-linux_arm64/benchmark/benchmark ${benchmark_test_path}/benchmark || exit 1 @@ -184,8 +184,8 @@ echo 'chmod 777 benchmark' >> adb_cmd.txt adb -s ${device_id} shell < adb_cmd.txt -run_x86_result=0 -run_arm64_result=0 +run_x86_result=0 || exit 1 +run_arm64_result=0 || exit 1 # Write resulte to temp file run_benchmark_result_file=${basepath}/run_benchmark_result.txt -- GitLab