Browse Source

!8865 fix some bugs on mslite train test ci

From: @xutianchun
Reviewed-by: @HilbertDavid,@ivss
Signed-off-by: @HilbertDavid
tags/v1.1.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
f4ba38ba56
3 changed files with 17 additions and 11 deletions
  1. +1
    -1
      mindspore/lite/test/models_ms_train.cfg
  2. +15
    -9
      mindspore/lite/test/run_net_train.sh
  3. +1
    -1
      mindspore/lite/tools/common/graph_util.cc

+ 1
- 1
mindspore/lite/test/models_ms_train.cfg View File

@@ -1,7 +1,7 @@
mini_alexnet mini_alexnet
#mobilenetv1 #mobilenetv1
#mobilenetv2 #mobilenetv2
mobilenetv3
#mobilenetv3 # this model got error when RunX86
lenet lenet
#effnet #effnet
effnet_tune effnet_tune


+ 15
- 9
mindspore/lite/test/run_net_train.sh View File

@@ -85,7 +85,7 @@ function Run_x86() {
if [ $? = 0 ]; then if [ $? = 0 ]; then
run_result='x86: '${model_name}'_train pass'; echo ${run_result} >> ${run_net_train_result_file} run_result='x86: '${model_name}'_train pass'; echo ${run_result} >> ${run_net_train_result_file}
else else
run_result='x86: '${model_name}'_train failed'; echo ${run_result} >> ${run_net_train_result_file}
run_result='x86: '${model_name}'_train failed'; echo ${run_result} >> ${run_net_train_result_file}; return 1
fi fi
done < ${models_mindspore_train_config} done < ${models_mindspore_train_config}
} }
@@ -131,10 +131,10 @@ function Run_arm() {
fi fi


cp -a ${arm_path}/mindspore-lite-${version_arm}-runtime-${arm_type}-${process_unit}-train/lib/libmindspore-lite.so ${net_train_test_path}/libmindspore-lite.so || exit 1 cp -a ${arm_path}/mindspore-lite-${version_arm}-runtime-${arm_type}-${process_unit}-train/lib/libmindspore-lite.so ${net_train_test_path}/libmindspore-lite.so || exit 1
if [ "$1" == arm64 ]; then
cp -a ${arm_path}/mindspore-lite-${version_arm}-runtime-${arm_type}-${process_unit}-train/lib/libmindspore-lite-fp16.so ${net_train_test_path}/libmindspore-lite-fp16.so || exit 1
cp -a ${arm_path}/mindspore-lite-${version_arm}-runtime-${arm_type}-${process_unit}-train/lib/libmindspore-lite-optimize.so ${net_train_test_path}/libmindspore-lite-optimize.so || exit 1
fi
# if [ "$1" == arm64 ]; then
# cp -a ${arm_path}/mindspore-lite-${version_arm}-runtime-${arm_type}-${process_unit}-train/lib/libmindspore-lite-fp16.so ${net_train_test_path}/libmindspore-lite-fp16.so || exit 1
# cp -a ${arm_path}/mindspore-lite-${version_arm}-runtime-${arm_type}-${process_unit}-train/lib/libmindspore-lite-optimize.so ${net_train_test_path}/libmindspore-lite-optimize.so || exit 1
# fi
cp -a ${arm_path}/mindspore-lite-${version_arm}-runtime-${arm_type}-${process_unit}-train/net_train/net_train ${net_train_test_path}/net_train || exit 1 cp -a ${arm_path}/mindspore-lite-${version_arm}-runtime-${arm_type}-${process_unit}-train/net_train/net_train ${net_train_test_path}/net_train || exit 1


# adb push all needed files to the phone # adb push all needed files to the phone
@@ -157,12 +157,15 @@ function Run_arm() {
echo ${model_name}'_train' >> "${run_arm_log_file}" echo ${model_name}'_train' >> "${run_arm_log_file}"
adb -s ${device_id} push ${train_io_path}/${model_name}_input*.bin ${train_io_path}/${model_name}_outputs.bin /data/local/tmp/net_train_test >> ${adb_push_log_file} adb -s ${device_id} push ${train_io_path}/${model_name}_input*.bin ${train_io_path}/${model_name}_outputs.bin /data/local/tmp/net_train_test >> ${adb_push_log_file}
echo 'cd /data/local/tmp/net_train_test' > ${adb_cmd_run_file} echo 'cd /data/local/tmp/net_train_test' > ${adb_cmd_run_file}
echo 'chmod 777 net_train' >> ${adb_cmd_run_file}
if [ "$1" == arm64 ]; then if [ "$1" == arm64 ]; then
echo 'cp /data/local/tmp/libc++_shared.so ./' >> ${adb_cmd_run_file}
echo 'export LD_LIBRARY_PATH=/data/local/tmp/net_train_test;./net_train --modelFile='${model_name}'_train.ms --inDataFile=/data/local/tmp/net_train_test/'${model_name}'_input1.bin,/data/local/tmp/net_train_test/'${model_name}'_input2.bin --expectedDataFile=/data/local/tmp/net_train_test/'${model_name}'_outputs.bin --exportFile='${model_name}'_train_exported.ms' >> "${run_arm_log_file}"
echo 'export LD_LIBRARY_PATH=/data/local/tmp/net_train_test;./net_train --modelFile='${model_name}'_train.ms --inDataFile=/data/local/tmp/net_train_test/'${model_name}'_input1.bin,/data/local/tmp/net_train_test/'${model_name}'_input2.bin --expectedDataFile=/data/local/tmp/net_train_test/'${model_name}'_outputs.bin --exportFile='${model_name}'_train_exported.ms' >> "${adb_cmd_run_file}"
elif [ "$1" == arm32 ]; then
echo 'cp /data/local/tmp/arm32/libc++_shared.so ./' >> ${adb_cmd_run_file}
echo 'export LD_LIBRARY_PATH=/data/local/tmp/net_train_test;./net_train --modelFile='${model_name}'_train.ms --inDataFile=/data/local/tmp/net_train_test/'${model_name}'_input1.bin,/data/local/tmp/net_train_test/'${model_name}'_input2.bin --expectedDataFile=/data/local/tmp/net_train_test/'${model_name}'_outputs.bin --exportFile='${model_name}'_train_exported.ms' >> "${run_arm_log_file}" echo 'export LD_LIBRARY_PATH=/data/local/tmp/net_train_test;./net_train --modelFile='${model_name}'_train.ms --inDataFile=/data/local/tmp/net_train_test/'${model_name}'_input1.bin,/data/local/tmp/net_train_test/'${model_name}'_input2.bin --expectedDataFile=/data/local/tmp/net_train_test/'${model_name}'_outputs.bin --exportFile='${model_name}'_train_exported.ms' >> "${run_arm_log_file}"
echo 'export LD_LIBRARY_PATH=/data/local/tmp/net_train_test;./net_train --modelFile='${model_name}'_train.ms --inDataFile=/data/local/tmp/net_train_test/'${model_name}'_input1.bin,/data/local/tmp/net_train_test/'${model_name}'_input2.bin --expectedDataFile=/data/local/tmp/net_train_test/'${model_name}'_outputs.bin --exportFile='${model_name}'_train_exported.ms' >> "${adb_cmd_run_file}" echo 'export LD_LIBRARY_PATH=/data/local/tmp/net_train_test;./net_train --modelFile='${model_name}'_train.ms --inDataFile=/data/local/tmp/net_train_test/'${model_name}'_input1.bin,/data/local/tmp/net_train_test/'${model_name}'_input2.bin --expectedDataFile=/data/local/tmp/net_train_test/'${model_name}'_outputs.bin --exportFile='${model_name}'_train_exported.ms' >> "${adb_cmd_run_file}"
elif [ "$1" == arm32 ]; then
echo 'export LD_LIBRARY_PATH=/data/local/tmp/:/data/local/tmp/net_train_test;./net_train --modelFile='${model_name}'_train.ms --inDataFile=/data/local/tmp/net_train_test/'${model_name}'_input1.bin,/data/local/tmp/net_train_test/'${model_name}'_input2.bin --expectedDataFile=/data/local/tmp/net_train_test/'${model_name}'_outputs.bin --exportFile='${model_name}'_train_exported.ms' >> "${run_arm_log_file}"
echo 'export LD_LIBRARY_PATH=/data/local/tmp/:/data/local/tmp/net_train_test;./net_train --modelFile='${model_name}'_train.ms --inDataFile=/data/local/tmp/net_train_test/'${model_name}'_input1.bin,/data/local/tmp/net_train_test/'${model_name}'_input2.bin --expectedDataFile=/data/local/tmp/net_train_test/'${model_name}'_outputs.bin --exportFile='${model_name}'_train_exported.ms' >> "${adb_cmd_run_file}"
fi fi


adb -s ${device_id} shell < ${adb_cmd_run_file} >> ${run_arm_log_file} adb -s ${device_id} shell < ${adb_cmd_run_file} >> ${run_arm_log_file}
@@ -170,7 +173,7 @@ function Run_arm() {
if [ $? = 0 ]; then if [ $? = 0 ]; then
run_result=$1': '${model_name}'_train pass'; echo ${run_result} >> ${run_net_train_result_file} run_result=$1': '${model_name}'_train pass'; echo ${run_result} >> ${run_net_train_result_file}
else else
run_result=$1': '${model_name}'_train failed'; echo ${run_result} >> ${run_net_train_result_file}
run_result=$1': '${model_name}'_train failed'; echo ${run_result} >> ${run_net_train_result_file}; return 1
fi fi
done < ${models_mindspore_train_config} done < ${models_mindspore_train_config}
} }
@@ -382,16 +385,19 @@ function Print_Benchmark_Result() {
if [[ ${Run_x86_status} != 0 ]];then if [[ ${Run_x86_status} != 0 ]];then
echo "Run_x86 failed" echo "Run_x86 failed"
cat ${run_x86_log_file} cat ${run_x86_log_file}
exit 1
fi fi


if [[ ${Run_arm64_status} != 0 ]];then if [[ ${Run_arm64_status} != 0 ]];then
echo "Run_arm64 failed" echo "Run_arm64 failed"
cat ${run_arm64_log_file} cat ${run_arm64_log_file}
exit 1
fi fi


if [[ ${Run_arm32_status} != 0 ]];then if [[ ${Run_arm32_status} != 0 ]];then
echo "Run_arm32 failed" echo "Run_arm32 failed"
cat ${run_arm32_log_file} cat ${run_arm32_log_file}
exit 1
fi fi


echo "Test ended - Results:" echo "Test ended - Results:"


+ 1
- 1
mindspore/lite/tools/common/graph_util.cc View File

@@ -692,7 +692,7 @@ STATUS ChangeOpAttrForSlice(schema::MetaGraphT *graph, const std::unique_ptr<sch
} }


STATUS ChangeOpAxis(schema::MetaGraphT *graph, const std::unique_ptr<schema::CNodeT> &node) { STATUS ChangeOpAxis(schema::MetaGraphT *graph, const std::unique_ptr<schema::CNodeT> &node) {
MS_ASSERT(node->primitive->value != nullptr);
MS_ASSERT(node->primitive != nullptr);
auto type = node->primitive->value.type; auto type = node->primitive->value.type;
auto input1_ndim = graph->allTensors.at(node->inputIndex[0])->dims.size(); auto input1_ndim = graph->allTensors.at(node->inputIndex[0])->dims.size();
if (input1_ndim != 4) { if (input1_ndim != 4) {


Loading…
Cancel
Save