diff --git a/utils.py b/utils.py index a34c480f6..34d9623cc 100644 --- a/utils.py +++ b/utils.py @@ -432,7 +432,7 @@ def cosine_scheduler(base_value, final_value, epochs, niter_per_ep, warmup_epoch if warmup_steps > 0: warmup_iters = warmup_steps print("Set warmup steps = %d" % warmup_iters) - if warmup_epochs > 0: + if warmup_iters > 0: warmup_schedule = np.linspace(start_warmup_value, base_value, warmup_iters) iters = np.arange(epochs * niter_per_ep - warmup_iters)