提交 c42e4dd6 编写于 作者: L liuyuhui

fix phase

上级 7cfe354b
...@@ -74,7 +74,9 @@ class Trainer(object): ...@@ -74,7 +74,9 @@ class Trainer(object):
phase_names = envs.get_global_env( phase_names = envs.get_global_env(
"runner." + self._runner_name + ".phases", None) "runner." + self._runner_name + ".phases", None)
print("phase_names:{}".format(phase_names))
_config = envs.load_yaml(config) _config = envs.load_yaml(config)
print("_config:{}".format(_config["phase"]))
self._context["env"] = _config self._context["env"] = _config
self._context["dataset"] = _config.get("dataset") self._context["dataset"] = _config.get("dataset")
...@@ -86,8 +88,11 @@ class Trainer(object): ...@@ -86,8 +88,11 @@ class Trainer(object):
for phase in _config.get("phase"): for phase in _config.get("phase"):
if phase["name"] in phase_names: if phase["name"] in phase_names:
phases.append(phase) phases.append(phase)
self._context["phases"] = phases self._context["phases"] = phases
_config["phase"] = phases
self._context["env"] = _config
self._context["dataset"] = _config.get("dataset")
print("self._context[\"phases\"]:{}".format(self._context["phases"]))
print("PaddleRec: Runner {} Begin".format(self._runner_name)) print("PaddleRec: Runner {} Begin".format(self._runner_name))
self.which_engine() self.which_engine()
self.which_device() self.which_device()
...@@ -254,6 +259,7 @@ class Trainer(object): ...@@ -254,6 +259,7 @@ class Trainer(object):
try: try:
self.reload_train_context() self.reload_train_context()
self.context_process(self._context) self.context_process(self._context)
print(self._context["env"]["phase"][0])
if self._context['is_exit']: if self._context['is_exit']:
break break
except Exception as err: except Exception as err:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册