From 2bc3bc0cbd660d72bfcb48bc9c02e1830ce4ee2c Mon Sep 17 00:00:00 2001 From: hmichaeli <54476245+hmichaeli@users.noreply.github.com> Date: Wed, 20 Apr 2022 16:08:57 +0300 Subject: [PATCH] bugfix - cosine scheduler with warmup steps Fix assertion when warmup_epochs = 0, warmup_steps > 0 --- utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)