提交 ae94c8e6 编写于 作者: G gaotingquan 提交者: sibo2rr

fix: raise warning when setting batch_transform_ops and TopkAcc

上级 149cd7d7
......@@ -161,6 +161,13 @@ class Engine(object):
if metric_config is not None:
metric_config = metric_config.get("Train")
if metric_config is not None:
if self.train_dataloader.collate_fn:
for m_idx, m in enumerate(metric_config):
if "TopkAcc" in m:
msg = f"'TopkAcc' metric can not be used when setting 'batch_transform_ops' in config. The 'TopkAcc' metric has been removed."
logger.warning(msg)
break
metric_config.pop(m_idx)
self.train_metric_func = build_metrics(metric_config)
else:
self.train_metric_func = None
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册