提交 bed79b44 编写于 作者: 李寅

Make config file param name friendly

上级 8f2eeef1
......@@ -108,8 +108,9 @@ def main(unused_args):
print("%s does not support dsp runtime yet." % FLAGS.platform)
sys.exit(-1)
else:
if FLAGS.transformers:
option = cvt.ConverterOption(FLAGS.transformers.split(','))
if FLAGS.graph_optimize_options:
option = cvt.ConverterOption(
FLAGS.graph_optimize_options.split(','))
else:
option = cvt.ConverterOption()
option.winograd = FLAGS.winograd
......@@ -287,10 +288,10 @@ def parse_args():
default="fp16_fp32",
help="fp16_fp32/fp32_fp32")
parser.add_argument(
"--transformers",
"--graph_optimize_options",
type=str,
default="",
help="model transformers")
help="graph optimize options")
return parser.parse_known_args()
......
......@@ -148,7 +148,7 @@ class YAMLKeyword(object):
obfuscate = 'obfuscate'
winograd = 'winograd'
validation_inputs_data = 'validation_inputs_data'
transformers = 'transformers' # keep it private for now
graph_optimize_options = 'graph_optimize_options' # internal use for now
class ModuleName(object):
......@@ -657,7 +657,7 @@ def convert_model(configs):
model_config[YAMLKeyword.obfuscate],
configs[YAMLKeyword.build_type],
data_type,
",".join(model_config.get(YAMLKeyword.transformers, [])))
",".join(model_config.get(YAMLKeyword.graph_optimize_options, [])))
if configs[YAMLKeyword.build_type] == BuildType.proto:
sh.mv("-f",
......
......@@ -490,7 +490,7 @@ def gen_model_code(model_codegen_dir,
obfuscate,
model_build_type,
data_type,
transformers):
graph_optimize_options):
bazel_build_common("//mace/python/tools:converter")
if os.path.exists(model_codegen_dir):
......@@ -517,7 +517,7 @@ def gen_model_code(model_codegen_dir,
"--output_dir=%s" % model_codegen_dir,
"--model_build_type=%s" % model_build_type,
"--data_type=%s" % data_type,
"--transformers=%s" % transformers,
"--graph_optimize_options=%s" % graph_optimize_options,
_fg=True)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册