提交 b61f8273 编写于 作者: 李寅

Merge branch 'abort-check' into 'master'

Fix converter.py not abort when mace run failed for old adb.

See merge request !560
...@@ -43,7 +43,6 @@ except Exception as e: ...@@ -43,7 +43,6 @@ except Exception as e:
################################ ################################
# common # common
################################ ################################
logger = logging.getLogger('MACE')
def strip_invalid_utf8(str): def strip_invalid_utf8(str):
...@@ -85,6 +84,15 @@ class BuildType(object): ...@@ -85,6 +84,15 @@ class BuildType(object):
code = 'code' code = 'code'
def stdout_success(stdout):
stdout_lines = stdout.split("\n")
for line in stdout_lines:
if "Aborted" in line or "FAILED" in line or \
"Segmentation fault" in line:
return False
return True
################################ ################################
# clear data # clear data
################################ ################################
...@@ -740,8 +748,11 @@ def tuning_run(abi, ...@@ -740,8 +748,11 @@ def tuning_run(abi,
_tty_in=True, _tty_in=True,
_out=process_output, _out=process_output,
_err_to_out=True) _err_to_out=True)
stdout = "".join(stdout_buff)
if not stdout_success(stdout):
common.MaceLogger.error("Mace Run", "Mace run failed.")
print("Running finished!\n") print("Running finished!\n")
return "".join(stdout_buff) return stdout
def validate_model(abi, def validate_model(abi,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册