未验证 提交 bfa1ac14 编写于 作者: C cuicheng01 提交者: GitHub

Merge pull request #2311 from PaddlePaddle/fix_bug

fix bugs to adapt to the new framework
......@@ -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):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册