From 1d15a7f2780b15d18dc0694bb76a3a6906437352 Mon Sep 17 00:00:00 2001 From: Andreas Daiminger Date: Wed, 28 Aug 2019 19:18:27 +0200 Subject: [PATCH] swap order of optimizer.step() and scheduler.step() --- examples/run_squad.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/run_squad.py b/examples/run_squad.py index 25e2c4093f..cc4eda306c 100644 --- a/examples/run_squad.py +++ b/examples/run_squad.py @@ -157,8 +157,8 @@ def train(args, train_dataset, model, tokenizer): tr_loss += loss.item() if (step + 1) % args.gradient_accumulation_steps == 0: - scheduler.step() # Update learning rate schedule optimizer.step() + scheduler.step() # Update learning rate schedule model.zero_grad() global_step += 1