提交 dabe486e 编写于 作者: L Liangliang He

Add model checksum and change build path format

上级 14d60644
...@@ -16,6 +16,7 @@ if [ "${BENCHMARK_FLAG}" = "1" ]; then ...@@ -16,6 +16,7 @@ if [ "${BENCHMARK_FLAG}" = "1" ]; then
fi fi
bazel-bin/lib/python/tools/tf_converter --input=${MODEL_FILE_PATH} \ bazel-bin/lib/python/tools/tf_converter --input=${MODEL_FILE_PATH} \
--model_checksum=${MODEL_SHA256_CHECKSUM} \
--output=${MODEL_CODEGEN_DIR}/model.cc \ --output=${MODEL_CODEGEN_DIR}/model.cc \
--input_node=${INPUT_NODE} \ --input_node=${INPUT_NODE} \
--output_node=${OUTPUT_NODE} \ --output_node=${OUTPUT_NODE} \
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
# --mode=all # --mode=all
import argparse import argparse
import base64 import hashlib
import os import os
import shutil import shutil
import subprocess import subprocess
...@@ -165,7 +165,7 @@ def parse_args(): ...@@ -165,7 +165,7 @@ def parse_args():
default="./tool/config", default="./tool/config",
help="The global config file of models.") help="The global config file of models.")
parser.add_argument( parser.add_argument(
"--output_dir", type=str, default="./build/", help="The output dir.") "--output_dir", type=str, default="build", help="The output dir.")
parser.add_argument( parser.add_argument(
"--round", type=int, default=1, help="The model running round.") "--round", type=int, default=1, help="The model running round.")
parser.add_argument( parser.add_argument(
...@@ -208,8 +208,10 @@ def main(unused_args): ...@@ -208,8 +208,10 @@ def main(unused_args):
for key in model_config: for key in model_config:
os.environ[key.upper()] = str(model_config[key]) os.environ[key.upper()] = str(model_config[key])
model_output_dir = FLAGS.output_dir + "/" + target_abi + "/" + model_name + "/" + base64.b16encode( md5 = hashlib.md5()
model_config["model_file_path"]) md5.update(model_config["model_file_path"])
model_path_digest = md5.hexdigest()
model_output_dir = "%s/%s/%s/%s" % (FLAGS.output_dir, model_name, model_path_digest, target_abi)
model_output_dirs.append(model_output_dir) model_output_dirs.append(model_output_dir)
if FLAGS.mode == "build" or FLAGS.mode == "all": if FLAGS.mode == "build" or FLAGS.mode == "all":
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册