提交 4e84e280 编写于 作者: M malin10

update

上级 bc93f8d2
...@@ -395,17 +395,22 @@ class PSRunner(RunnerBase): ...@@ -395,17 +395,22 @@ class PSRunner(RunnerBase):
end_time = time.time() end_time = time.time()
seconds = end_time - begin_time seconds = end_time - begin_time
message = "epoch {} done, use time: {}".format(epoch, seconds) message = "epoch {} done, use time: {}".format(epoch, seconds)
metrics_result = []
for key in metrics: # TODO, wait for PaddleCloudRoleMaker supports gloo
if isinstance(metrics[key], Metric): from paddle.fluid.incubate.fleet.base.role_maker import GeneralRoleMaker
_str = metrics[key].cal_global_metrics( if context["fleet"] is not None and isinstance(context["fleet"],
context["fleet"], GeneralRoleMaker):
context["model"][model_dict["name"]]["scope"]) metrics_result = []
elif result is not None: for key in metrics:
_str = "{}={}".format(key, result[key]) if isinstance(metrics[key], Metric):
metrics_result.append(_str) _str = metrics[key].cal_global_metrics(
if len(metrics_result) > 0: context["fleet"],
message += ", global metrics: " + ", ".join(metrics_result) context["model"][model_dict["name"]]["scope"])
elif result is not None:
_str = "{}={}".format(key, result[key])
metrics_result.append(_str)
if len(metrics_result) > 0:
message += ", global metrics: " + ", ".join(metrics_result)
print(message) print(message)
with fluid.scope_guard(context["model"][model_dict["name"]][ with fluid.scope_guard(context["model"][model_dict["name"]][
"scope"]): "scope"]):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册