textual_inversion
textual_inversion copied to clipboard
Fix for issue #72
The issue this resolves was closed without resolution, but it was bugging me enough and wasting my GPU time too much that I felt a need to fix it.
Adds an attribute to track the current index and prevents logging an image if there has already been a logging attempt at the current index.
This prevents a circumstance where the image logger can trigger more than once in rapid succession, generally when multiple iterations occur during a single global step, such as:
- When
accumulate_grad_batches > 1
. - When the validation data-loader triggers at the end of an epoch, and that global step happens to align with image logging.