Skip to content

Commit

Permalink
Update trainer.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ftgreat committed Apr 28, 2024
1 parent 5ecde7e commit a6128ae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions flagai/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ def train_step_pytorch(self,
optimizer.zero_grad()
else:
optimizer.step()
# optimizer.zero_grad()
optimizer.zero_grad()
self.accumulate_count = 0
else:
self.accumulate_count += 1
Expand Down Expand Up @@ -775,7 +775,7 @@ def train_step_pytorchDDP(self,
optimizer.zero_grad()
else:
optimizer.step()
# model.zero_grad()
model.zero_grad()

self.accumulate_count = 0
else:
Expand Down

0 comments on commit a6128ae

Please sign in to comment.