From 13007ebdf8c16e02a031e91e800c87b3588f77d1 Mon Sep 17 00:00:00 2001 From: yejianwu Date: Mon, 26 Nov 2018 17:06:44 +0800 Subject: [PATCH] fix quantize model in android example and add TODO comment for memory leak --- mace/examples/android/build.sh | 2 +- .../examples/android/macelibrary/src/main/cpp/image_classify.cc | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/mace/examples/android/build.sh b/mace/examples/android/build.sh index 4bbb177d..c1bf9cbb 100755 --- a/mace/examples/android/build.sh +++ b/mace/examples/android/build.sh @@ -56,7 +56,7 @@ python tools/converter.py convert --config=mace/examples/android/mobilenet.yml - cp -rf builds/mobilenet/include/mace/public/*.h $INCLUDE_DIR cp -rf builds/mobilenet/model $LIBRARY_DIR -bazel build --config android --config optimization $BAZEL_LIBMACE_TARGET --define neon=true --define openmp=true --define opencl=true --cpu=$TARGET_ABI +bazel build --config android --config optimization $BAZEL_LIBMACE_TARGET --define neon=true --define openmp=true --define opencl=true --define quantize=true --cpu=$TARGET_ABI cp -rf mace/public/*.h $INCLUDE_DIR cp -rf $BAZEL_GEN_LIBMACE_PATH $LIBMACE_DIR 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 b414782a..f27519b6 100755 --- a/mace/examples/android/macelibrary/src/main/cpp/image_classify.cc +++ b/mace/examples/android/macelibrary/src/main/cpp/image_classify.cc @@ -68,6 +68,7 @@ mace::DeviceType ParseDeviceType(const std::string &device) { } MaceContext& GetMaceContext() { + // TODO(yejianwu): In multi-dlopen process, this step may cause memory leak. static auto *mace_context = new MaceContext; return *mace_context; -- GitLab