From 1e3ef98a2dc1fea1e81c62dc92fbca8ed7954c4c Mon Sep 17 00:00:00 2001 From: wangyanling Date: Sun, 25 Apr 2021 15:16:32 +0800 Subject: [PATCH] fix Segmentation fault of resnext50 at Samsung phone --- mindspore/lite/test/models_compatibility.cfg | 3 ++- mindspore/lite/test/run_benchmark_nets.sh | 12 +++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/mindspore/lite/test/models_compatibility.cfg b/mindspore/lite/test/models_compatibility.cfg index 15e6fc3ef6..c85ab9c6b6 100644 --- a/mindspore/lite/test/models_compatibility.cfg +++ b/mindspore/lite/test/models_compatibility.cfg @@ -1,3 +1,4 @@ inception_v4_ms_r1.0 mobilenet_v2_1.0_224_ms_r1.0 -resnext50_ms_r1.0 +# Add input shapes to fix Segmentation fault at Samsung phone +resnext50_ms_r1.0;1,224,224,3 diff --git a/mindspore/lite/test/run_benchmark_nets.sh b/mindspore/lite/test/run_benchmark_nets.sh index 9b734b6ea4..e8a11f9499 100644 --- a/mindspore/lite/test/run_benchmark_nets.sh +++ b/mindspore/lite/test/run_benchmark_nets.sh @@ -1285,14 +1285,16 @@ function Run_arm64() { # Run compatibility test models: while read line; do - model_name=${line} + model_name=${line%;*} + length=${#model_name} + input_shapes=${line:length+1} if [[ $model_name == \#* ]]; then continue fi echo ${model_name} >> "${run_arm64_fp32_log_file}" echo 'cd /data/local/tmp/benchmark_test' > adb_run_cmd.txt - echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/data/local/tmp/benchmark_test;./benchmark --modelFile='${model_name}'.ms' >> "${run_arm64_fp32_log_file}" - echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/data/local/tmp/benchmark_test;./benchmark --modelFile='${model_name}'.ms' >> adb_run_cmd.txt + echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/data/local/tmp/benchmark_test;./benchmark --modelFile='${model_name}'.ms --inputShapes='${input_shapes} >> "${run_arm64_fp32_log_file}" + echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/data/local/tmp/benchmark_test;./benchmark --modelFile='${model_name}'.ms --inputShapes='${input_shapes} >> adb_run_cmd.txt adb -s ${device_id} shell < adb_run_cmd.txt >> "${run_arm64_fp32_log_file}" if [ $? = 0 ]; then run_result='arm64: '${model_name}' pass'; echo ${run_result} >> ${run_benchmark_result_file} @@ -1301,8 +1303,8 @@ function Run_arm64() { fi # run benchmark test without clib data echo 'cd /data/local/tmp/benchmark_test' > adb_run_cmd.txt - echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/data/local/tmp/benchmark_test;./benchmark --modelFile='${model_name}'.ms --warmUpLoopCount=1 --loopCount=2' >> "${run_arm64_fp32_log_file}" - echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/data/local/tmp/benchmark_test;./benchmark --modelFile='${model_name}'.ms --warmUpLoopCount=1 --loopCount=2' >> adb_run_cmd.txt + echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/data/local/tmp/benchmark_test;./benchmark --modelFile='${model_name}'.ms --warmUpLoopCount=1 --loopCount=2 --inputShapes='${input_shapes} >> "${run_arm64_fp32_log_file}" + echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/data/local/tmp/benchmark_test;./benchmark --modelFile='${model_name}'.ms --warmUpLoopCount=1 --loopCount=2 --inputShapes='${input_shapes} >> adb_run_cmd.txt adb -s ${device_id} shell < adb_run_cmd.txt >> "${run_arm64_fp32_log_file}" if [ $? = 0 ]; then run_result='arm64: '${model_name}' pass'; echo ${run_result} >> ${run_benchmark_result_file}