diff --git a/core/trainers/framework/runner.py b/core/trainers/framework/runner.py index 56a3fb01d22ccc5041f7e5f4288e3d6e4c62be79..91164a65a51db847a53df8503e497fa14655508c 100644 --- a/core/trainers/framework/runner.py +++ b/core/trainers/framework/runner.py @@ -359,9 +359,10 @@ class SingleRunner(RunnerBase): _str = metrics[key].cal_global_metrics( None, context["model"][model_dict["name"]]["scope"]) + metrics_result.append(_str) elif result is not None: _str = "{}={}".format(key, result[key]) - metrics_result.append(_str) + metrics_result.append(_str) if len(metrics_result) > 0: message += ", global metrics: " + ", ".join(metrics_result) print(message) @@ -406,9 +407,10 @@ class PSRunner(RunnerBase): _str = metrics[key].cal_global_metrics( context["fleet"], context["model"][model_dict["name"]]["scope"]) + metrics_result.append(_str) elif result is not None: _str = "{}={}".format(key, result[key]) - metrics_result.append(_str) + metrics_result.append(_str) if len(metrics_result) > 0: message += ", global metrics: " + ", ".join(metrics_result) print(message) @@ -537,9 +539,10 @@ class SingleInferRunner(RunnerBase): _str = metrics[key].cal_global_metrics( None, context["model"][model_dict["name"]]["scope"]) + metrics_result.append(_str) elif result is not None: _str = "{}={}".format(key, result[key]) - metrics_result.append(_str) + metrics_result.append(_str) if len(metrics_result) > 0: message += ", global metrics: " + ", ".join(metrics_result) print(message)