Skip to content

Commit

Permalink
fix(train): step lr schedulers at end of epoch (#291)
Browse files Browse the repository at this point in the history
  • Loading branch information
guranon authored Apr 11, 2023
1 parent 94a062b commit 3af223e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/so_vits_svc_fork/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,11 @@ def training_step(self, batch: dict[str, torch.Tensor], batch_idx: int) -> None:
optim_d.step()
self.untoggle_optimizer(optim_d)

# end of epoch
if self.trainer.is_last_batch:
self.scheduler_g.step()
self.scheduler_d.step()

def validation_step(self, batch, batch_idx):
with torch.no_grad():
self.net_g.eval()
Expand Down

0 comments on commit 3af223e

Please sign in to comment.