diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3fab75003f85aa347337f1b9580d966a1a704b69..5b4786513afbda052c7aab7d023783ab3ad43ef0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -107,6 +107,11 @@ python_tools_tests: - rm -rf mace-models - GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" git clone git@github.com:XiaoMi/mace-models.git - CONF_FILE=mace-models/mobilenet-v2/mobilenet-v2.yml + - > + python tools/converter.py convert --config=${CONF_FILE} --target_abis=armeabi-v7a --model_graph_format=file --model_data_format=file || exit 1; + python tools/converter.py run --config=${CONF_FILE} --round=1 --target_abis=armeabi-v7a --validate --model_graph_format=file --model_data_format=file || exit 1; + python tools/converter.py run --config=${CONF_FILE} --example --target_abis=armeabi-v7a --round=1 --validate --model_graph_format=file --model_data_format=file || exit 1; + - CONF_FILE=mace-models/mobilenet-v2/mobilenet-v2-host.yml - > python tools/converter.py convert --config=${CONF_FILE} --model_graph_format=file --model_data_format=file || exit 1; python tools/converter.py run --config=${CONF_FILE} --round=1 --validate --model_graph_format=file --model_data_format=file || exit 1; diff --git a/tools/converter.py b/tools/converter.py index eba4aa0455932e77b0f7d6fff9b4852fef57823e..0b3fca515862c526f4599e25cd5c24a54a513661 100644 --- a/tools/converter.py +++ b/tools/converter.py @@ -1196,6 +1196,16 @@ def run_specific_target(flags, configs, target_abi, opencl_parameter_bin_path) +def print_package_summary(package_path): + title = "Library" + header = ["key", "value"] + data = list() + data.append(["MACE Model package Path", + package_path]) + + MaceLogger.summary(StringFormatter.table(header, data, title)) + + def run_mace(flags): configs = format_model_config(flags) if flags.mace_lib_type == MACELibType.dynamic and \ @@ -1237,6 +1247,11 @@ def run_mace(flags): run_specific_target(flags, configs, target_abi, target_soc, serial_num) + # package the output files + package_path = sh_commands.packaging_lib(BUILD_OUTPUT_DIR, + configs[YAMLKeyword.library_name]) + print_package_summary(package_path) + ################################ # benchmark model diff --git a/tools/sh_commands.py b/tools/sh_commands.py index b0adb2c5ae876d26bbfbd62c31cfc415ea92d6fd..4c033fe8fd4bd9582a3a127366c143fc185d0b4e 100644 --- a/tools/sh_commands.py +++ b/tools/sh_commands.py @@ -934,6 +934,7 @@ def packaging_lib(libmace_output_dir, project_name): glob.glob("%s/*" % project_dir), _fg=True) print("Packaging Done!\n") + return tar_package_path ################################