From e58f12c72d488b3d40af2c957b376963facb10cb Mon Sep 17 00:00:00 2001 From: isamu-isozaki Date: Thu, 16 Feb 2023 14:31:46 -0500 Subject: [PATCH] Slight error in accelerator --- driver.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driver.py b/driver.py index 489c27f..dee78f2 100644 --- a/driver.py +++ b/driver.py @@ -128,7 +128,7 @@ def main(): with accelerator.accumulate(model): loss = diffusion(mask, img) accelerator.log({'loss': loss}) # Log loss to wandb - loss.backward() + accelerator.backward(loss) optimizer.step() optimizer.zero_grad() running_loss += loss.item() * img.size(0)