Commit d28845e1 authored by guanfuchen's avatar guanfuchen Committed by Francisco Massa

a Python 2-3 compatibility issue in lr_scheduler.py (#342)

parent 0844f577
......@@ -42,7 +42,7 @@ class WarmupMultiStepLR(torch.optim.lr_scheduler._LRScheduler):
if self.warmup_method == "constant":
warmup_factor = self.warmup_factor
elif self.warmup_method == "linear":
alpha = self.last_epoch / self.warmup_iters
alpha = float(self.last_epoch) / self.warmup_iters
warmup_factor = self.warmup_factor * (1 - alpha) + alpha
return [
base_lr
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment