Skip to content

Commit

Permalink
Merge pull request #6 from dsbuddy/accelerated_train
Browse files Browse the repository at this point in the history
Slight error in accelerator
  • Loading branch information
lucidrains authored Feb 16, 2023
2 parents 85538c7 + e58f12c commit b7c6162
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b7c6162

Please sign in to comment.