提交 b3678234 编写于 作者: G gaotingquan 提交者: cuicheng01

fix bug when update_freq > iter_per_epoch

上级 37795086
......@@ -141,6 +141,11 @@ class Engine(object):
# set max iteration per epoch mannualy, when training by iteration(s), such as XBM, FixMatch.
self.iter_per_epoch = self.config["Global"].get(
"iter_per_epoch")
if self.iter_per_epoch < self.update_freq:
logger.warning(
"The arg Global.update_freq greater than iter_per_epoch and has been set to 1. This may be caused by too few of batches."
)
self.update_freq = 1
self.iter_per_epoch = self.iter_per_epoch // self.update_freq * self.update_freq
if self.mode == "eval" or (self.mode == "train" and
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册