diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3d6ad0ccf22a2dc352938ae24a3c823f72cc7b3e..06928c94a1f0be17a03101d15f8418dd0aafdd9b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -146,6 +146,12 @@ model_tests: python tools/converter.py convert --config=${CONF_FILE} --target_socs=$TARGET_SOCS --model_graph_format=file --model_data_format=file || exit 1; python tools/converter.py run --config=${CONF_FILE} --target_socs=$TARGET_SOCS --round=1 --validate --model_graph_format=file --model_data_format=file || exit 1; python tools/converter.py run --config=${CONF_FILE} --target_socs=$TARGET_SOCS --example --round=1 --validate --model_graph_format=file --model_data_format=file || exit 1; + python tools/converter.py benchmark --config=${CONF_FILE} --target_socs=$TARGET_SOCS --round=5 --model_graph_format=file --model_data_format=file || exit 1; + python tools/converter.py convert --config=${CONF_FILE} --target_socs=$TARGET_SOCS --model_graph_format=code --model_data_format=file || exit 1; + python tools/converter.py run --config=${CONF_FILE} --target_socs=$TARGET_SOCS --round=1 --validate --model_graph_format=code --model_data_format=file || exit 1; + python tools/converter.py run --config=${CONF_FILE} --target_socs=$TARGET_SOCS --example --round=1 --validate --model_graph_format=code --model_data_format=file || exit 1; + python tools/converter.py benchmark --config=${CONF_FILE} --target_socs=$TARGET_SOCS --round=5 --model_graph_format=code --model_data_format=file || exit 1; + - rm -rf mace-models quantization_tests: diff --git a/docs/user_guide/advanced_usage.rst b/docs/user_guide/advanced_usage.rst index bea021601d3632e1f29b5d85936c281e847e2538..58c0f9352df91652220f6c45c0e5a76a504d4d80 100644 --- a/docs/user_guide/advanced_usage.rst +++ b/docs/user_guide/advanced_usage.rst @@ -252,7 +252,8 @@ Convert model(s) to C++ code // Create Engine from compiled code create_engine_status = CreateMaceEngineFromCode(model_name.c_str(), - model_data_file, // empty string if model_data_format is code + model_data_ptr, // nullptr if model_data_format is code + model_data_size, // 0 if model_data_format is code input_names, output_names, device_type, diff --git a/mace/benchmark/benchmark_model.cc b/mace/benchmark/benchmark_model.cc index e23c3a02beb8cd40202c8d5aeedaa193513e6790..4bd44ada514baf095cdb4bdfb6520808a285172c 100644 --- a/mace/benchmark/benchmark_model.cc +++ b/mace/benchmark/benchmark_model.cc @@ -292,8 +292,8 @@ int Main(int argc, char **argv) { #ifdef MODEL_GRAPH_FORMAT_CODE create_engine_status = CreateMaceEngineFromCode(FLAGS_model_name, - model_weights_data.data(), - model_weights_data.size(), + model_weights_data, + model_weights_data_size, input_names, output_names, config, diff --git a/mace/examples/android/macelibrary/src/main/cpp/image_classify.cc b/mace/examples/android/macelibrary/src/main/cpp/image_classify.cc index 661da75c7665aaf1118f6c99dca165ceb1453620..442e3a1a25f5d22bc8198e0c5b6d87894738f4e8 100755 --- a/mace/examples/android/macelibrary/src/main/cpp/image_classify.cc +++ b/mace/examples/android/macelibrary/src/main/cpp/image_classify.cc @@ -158,7 +158,8 @@ Java_com_xiaomi_mace_JniMaceUtils_maceMobilenetCreateEngine( mace::MaceStatus create_engine_status = CreateMaceEngineFromCode(mace_context.model_name, - std::string(), + nullptr, + 0, input_names, output_names, config, diff --git a/mace/examples/cli/example.cc b/mace/examples/cli/example.cc index 15ab07804de9365dbd2d0b06b7c263e0951d9947..97d3608116914423be21b05f02307b64a850eabd 100644 --- a/mace/examples/cli/example.cc +++ b/mace/examples/cli/example.cc @@ -285,8 +285,8 @@ bool RunModel(const std::vector &input_names, // to model_data_file parameter. create_engine_status = CreateMaceEngineFromCode(FLAGS_model_name, - model_weights_data.data(), - model_weights_data.size(), + model_weights_data, + model_weights_data_size, input_names, output_names, config, diff --git a/mace/tools/validation/mace_run.cc b/mace/tools/validation/mace_run.cc index c4d30765dbff06839140cb136417c3739cc03445..7ea06f089eca63a189edac2306641bac81e39c7f 100644 --- a/mace/tools/validation/mace_run.cc +++ b/mace/tools/validation/mace_run.cc @@ -268,8 +268,8 @@ bool RunModel(const std::string &model_name, #ifdef MODEL_GRAPH_FORMAT_CODE create_engine_status = CreateMaceEngineFromCode(model_name, - model_weights_data.data(), - model_weights_data.size(), + model_weights_data, + model_weights_data_size, input_names, output_names, config, @@ -349,8 +349,8 @@ bool RunModel(const std::string &model_name, #ifdef MODEL_GRAPH_FORMAT_CODE create_engine_status = CreateMaceEngineFromCode(model_name, - model_weights_data.data(), - model_weights_data.size(), + model_weights_data, + model_weights_data_size, input_names, output_names, config, @@ -392,8 +392,8 @@ bool RunModel(const std::string &model_name, #ifdef MODEL_GRAPH_FORMAT_CODE create_engine_status = CreateMaceEngineFromCode(model_name, - model_weights_data.data(), - model_weights_data.size(), + model_weights_data, + model_weights_data_size, input_names, output_names, config,