From aa796f9ddd2e61b4553a43e5f77b1ee64b0e8cbc Mon Sep 17 00:00:00 2001 From: yejianwu Date: Wed, 7 Feb 2018 14:43:56 +0800 Subject: [PATCH] update run mode in mace_tools.py --- build_mace_run.sh | 5 +++++ mace_tools.py | 3 --- tuning_run.sh | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/build_mace_run.sh b/build_mace_run.sh index a62788da..1b53a294 100644 --- a/build_mace_run.sh +++ b/build_mace_run.sh @@ -56,3 +56,8 @@ fi if [ "$PRODUCTION_MODE" = 1 ]; then cp $GENERATED_MODEL_LIB_PATH $MODEL_OUTPUT_DIR/libmace_${MODEL_TAG}.a fi + +if [ -f "$MODEL_OUTPUT_DIR/mace_run" ]; then + rm -rf $MODEL_OUTPUT_DIR/mace_run +fi +cp bazel-bin/examples/mace_run $MODEL_OUTPUT_DIR diff --git a/mace_tools.py b/mace_tools.py index 05c4afcb..4909e5e2 100644 --- a/mace_tools.py +++ b/mace_tools.py @@ -251,9 +251,6 @@ def main(unused_args): libmace_name = get_libs(configs) - if FLAGS.mode == "run" and len(configs) > 1: - raise Exception("Mode 'run' only can execute one model config, which have been built lastest") - model_output_dirs = [] for config in configs: # Transfer params by environment diff --git a/tuning_run.sh b/tuning_run.sh index ec92665e..5a348f7e 100644 --- a/tuning_run.sh +++ b/tuning_run.sh @@ -19,7 +19,7 @@ PRODUCTION_MODE=$4 if [ x"$RUNTIME" = x"local" ]; then MACE_CPP_MIN_VLOG_LEVEL=$VLOG_LEVEL \ - bazel-bin/examples/mace_run \ + ${MODEL_OUTPUT_DIR}/mace_run \ --input_shape="${INPUT_SHAPE}"\ --output_shape="${OUTPUT_SHAPE}"\ --input_file=${MODEL_OUTPUT_DIR}/${INPUT_FILE_NAME} \ @@ -38,7 +38,7 @@ else adb shell "mkdir -p ${KERNEL_DIR}" || exit 1 fi adb push ${MODEL_OUTPUT_DIR}/${INPUT_FILE_NAME} ${PHONE_DATA_DIR} || exit 1 - adb push bazel-bin/examples/mace_run ${PHONE_DATA_DIR} || exit 1 + adb push ${MODEL_OUTPUT_DIR}/mace_run ${PHONE_DATA_DIR} || exit 1 adb push lib/hexagon/libhexagon_controller.so ${PHONE_DATA_DIR} || exit 1 adb