diff options
author | Volpeon <git@volpeon.ink> | 2023-04-21 11:43:50 +0200 |
---|---|---|
committer | Volpeon <git@volpeon.ink> | 2023-04-21 11:43:50 +0200 |
commit | 7da4f0485032bb8b8acfc678546ffcea3a23a44b (patch) | |
tree | 1e7880189df21132861114b5dbf4c614405c9855 /training/functional.py | |
parent | Fix PTI (diff) | |
download | textual-inversion-diff-7da4f0485032bb8b8acfc678546ffcea3a23a44b.tar.gz textual-inversion-diff-7da4f0485032bb8b8acfc678546ffcea3a23a44b.tar.bz2 textual-inversion-diff-7da4f0485032bb8b8acfc678546ffcea3a23a44b.zip |
Update
Diffstat (limited to 'training/functional.py')
-rw-r--r-- | training/functional.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/training/functional.py b/training/functional.py index c6ceb20..695a24f 100644 --- a/training/functional.py +++ b/training/functional.py | |||
@@ -456,7 +456,7 @@ def train_loop( | |||
456 | sample_frequency: int = 10, | 456 | sample_frequency: int = 10, |
457 | checkpoint_frequency: int = 50, | 457 | checkpoint_frequency: int = 50, |
458 | milestone_checkpoints: bool = True, | 458 | milestone_checkpoints: bool = True, |
459 | cycle: int = 1, | 459 | cycle: int = 0, |
460 | global_step_offset: int = 0, | 460 | global_step_offset: int = 0, |
461 | num_epochs: int = 100, | 461 | num_epochs: int = 100, |
462 | gradient_accumulation_steps: int = 1, | 462 | gradient_accumulation_steps: int = 1, |
@@ -537,7 +537,7 @@ def train_loop( | |||
537 | 537 | ||
538 | logs = {} | 538 | logs = {} |
539 | 539 | ||
540 | with on_train(epoch): | 540 | with on_train(cycle): |
541 | for step, batch in enumerate(train_dataloader): | 541 | for step, batch in enumerate(train_dataloader): |
542 | loss, acc, bsz = loss_step(step, batch, cache) | 542 | loss, acc, bsz = loss_step(step, batch, cache) |
543 | loss /= gradient_accumulation_steps | 543 | loss /= gradient_accumulation_steps |