From 474c918b279bcbe42d9c994e3cf90b20b9c23c9f Mon Sep 17 00:00:00 2001 From: gaotingquan Date: Wed, 13 Apr 2022 09:19:30 +0000 Subject: [PATCH] fix: fix bug of batch_size statistics error --- ppcls/engine/evaluation/classification.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ppcls/engine/evaluation/classification.py b/ppcls/engine/evaluation/classification.py index 446226fb..d7c69746 100644 --- a/ppcls/engine/evaluation/classification.py +++ b/ppcls/engine/evaluation/classification.py @@ -126,7 +126,8 @@ def classification_eval(engine, epoch_id=0): for key in loss_dict: if key not in output_info: output_info[key] = AverageMeter(key, '7.5f') - output_info[key].update(loss_dict[key].numpy()[0], batch_size) + output_info[key].update(loss_dict[key].numpy()[0], + current_samples) # calc metric if engine.eval_metric_func is not None: metric_dict = engine.eval_metric_func(preds, labels) -- GitLab