From cc46db158656c5544d1f89f346aeacb7dffa0ee6 Mon Sep 17 00:00:00 2001 From: cuicheng01 Date: Mon, 19 Sep 2022 02:01:31 +0000 Subject: [PATCH] fix bugs to adapt to the new framework --- ppcls/engine/evaluation/classification.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ppcls/engine/evaluation/classification.py b/ppcls/engine/evaluation/classification.py index 5b305b0a..647a8217 100644 --- a/ppcls/engine/evaluation/classification.py +++ b/ppcls/engine/evaluation/classification.py @@ -81,8 +81,9 @@ def classification_eval(engine, epoch_id=0): # gather Tensor when distributed if paddle.distributed.get_world_size() > 1: label_list = [] - - paddle.distributed.all_gather(label_list, batch[1]) + label = batch[1].cuda() if engine.config["Global"][ + "device"] == "gpu" else batch[1] + paddle.distributed.all_gather(label_list, label) labels = paddle.concat(label_list, 0) if isinstance(out, list): -- GitLab