提交 c0ac3bf4 编写于 作者: C chengmo

fix ci error code

上级 e55a86c8
......@@ -191,17 +191,10 @@ class Trainer(object):
None : run a processor for this status
"""
status = context['status']
try:
if status in self._status_processor:
self._status_processor[context['status']](context)
else:
self.other_status_processor(context)
except Exception as err:
traceback.print_exc()
print('Catch Exception:%s' % str(err))
sys.stdout.flush()
self._context['is_exit'] = self.handle_processor_exception(
status, context, err)
def other_status_processor(self, context):
"""
......@@ -218,7 +211,7 @@ class Trainer(object):
Return:
bool exit_app or not
"""
print('Exit app. catch exception in precoss status:%s, except:%s' %
print('Exit app. catch exception in precoss status: [%s], except: %s' %
(context['status'], str(exception)))
return True
......@@ -233,10 +226,17 @@ class Trainer(object):
keep running by statu context.
"""
while True:
try:
self.reload_train_context()
self.context_process(self._context)
if self._context['is_exit']:
break
except Exception as err:
traceback.print_exc()
print('Catch Exception:%s' % str(err))
sys.stdout.flush()
self.handle_processor_exception(status, context, err)
sys.exit(type(err).__name__)
def user_define_engine(engine_yaml):
......
......@@ -449,8 +449,4 @@ if __name__ == "__main__":
engine_registry()
which_engine = get_engine(args)
engine = which_engine(args)
try:
engine.run()
sys.exit(0)
except:
sys.exit(1)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册