提交 d4124708 编写于 作者: 李寅

Merge branch 'model_name_bug' into 'master'

Fix model_name check bugs.

See merge request !549
...@@ -183,7 +183,7 @@ bool RunModel(const std::vector<std::string> &input_names, ...@@ -183,7 +183,7 @@ bool RunModel(const std::vector<std::string> &input_names,
&engine); &engine);
} else { } else {
create_engine_status = create_engine_status =
CreateMaceEngineFromCode(model_name, CreateMaceEngineFromCode(FLAGS_model_name,
FLAGS_model_data_file, FLAGS_model_data_file,
input_names, input_names,
output_names, output_names,
......
...@@ -279,7 +279,7 @@ def format_model_config(config_file_path): ...@@ -279,7 +279,7 @@ def format_model_config(config_file_path):
mace_check(len(model_names) > 0, ModuleName.YAML_CONFIG, mace_check(len(model_names) > 0, ModuleName.YAML_CONFIG,
"no model found in config file") "no model found in config file")
model_name_reg = re.compile(r'^[a-z0-9_]+$') model_name_reg = re.compile(r'^[a-zA-Z0-9_]+$')
for model_name in model_names: for model_name in model_names:
# check model_name legality # check model_name legality
mace_check(model_name not in CPP_KEYWORDS, mace_check(model_name not in CPP_KEYWORDS,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册