提交 eb939222 编写于 作者: L liuqi

Add bazel build opt to support multiple model for mace_run.

上级 8bd06f5e
...@@ -21,7 +21,7 @@ using namespace std; ...@@ -21,7 +21,7 @@ using namespace std;
using namespace mace; using namespace mace;
namespace mace { namespace mace {
extern NetDef CreateGCN512(); extern NetDef MACE_MODEL_FUNCTION();
} }
void ParseShape(const string &str, vector<index_t> *shape) { void ParseShape(const string &str, vector<index_t> *shape) {
string tmp = str; string tmp = str;
...@@ -95,7 +95,7 @@ int main(int argc, char **argv) { ...@@ -95,7 +95,7 @@ int main(int argc, char **argv) {
// NetDef net_def; // NetDef net_def;
// net_def.ParseFromIstream(&file_stream); // net_def.ParseFromIstream(&file_stream);
// file_stream.close(); // file_stream.close();
NetDef net_def = mace::CreateGCN512(); NetDef net_def = mace::MACE_MODEL_FUNCTION();
DeviceType device_type = ParseDeviceType(device); DeviceType device_type = ParseDeviceType(device);
VLOG(0) << device_type; VLOG(0) << device_type;
......
...@@ -46,10 +46,12 @@ bazel-bin/mace/python/tools/tf_converter --input=${TF_MODEL_FILE_PATH} \ ...@@ -46,10 +46,12 @@ bazel-bin/mace/python/tools/tf_converter --input=${TF_MODEL_FILE_PATH} \
# Step 3: Run model on the phone # Step 3: Run model on the phone
echo "Step 3: Run model on the phone" echo "Step 3: Run model on the phone"
echo Create${MODEL_TAG}
bazel build -c opt --strip always mace/examples:mace_run \ bazel build -c opt --strip always mace/examples:mace_run \
--crosstool_top=//external:android/crosstool \ --crosstool_top=//external:android/crosstool \
--host_crosstool_top=@bazel_tools//tools/cpp:toolchain \ --host_crosstool_top=@bazel_tools//tools/cpp:toolchain \
--cpu=arm64-v8a --cpu=arm64-v8a \
--copt=-DMACE_MODEL_FUNCTION=Create${MODEL_TAG}
adb shell "mkdir -p ${PHONE_DATA_DIR}" adb shell "mkdir -p ${PHONE_DATA_DIR}"
adb shell "mkdir -p ${KERNEL_DIR}" adb shell "mkdir -p ${KERNEL_DIR}"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册