This commit is contained in:
Vladimir Mandic
2023-01-09 17:38:58 -05:00
parent 02dddd2feb
commit 5754401e50
2 changed files with 3 additions and 5 deletions
+1 -1
View File
@@ -1,3 +1,3 @@
# Stable Diffusion - Automatic
Custom fork of <https://github.com/AUTOMATIC1111/stable-diffusion-webui>
Heavily opinionated custom fork of <https://github.com/AUTOMATIC1111/stable-diffusion-webui>
@@ -255,13 +255,11 @@ def write_loss(log_directory, filename, step, epoch_len, values):
if step % shared.opts.training_write_csv_every != 0:
return
write_csv_header = False if os.path.exists(os.path.join(log_directory, filename)) else True
with open(os.path.join(log_directory, filename), "a+", newline='') as fout:
with open(os.path.join(log_directory, filename), "w", newline='') as fout:
csv_writer = csv.DictWriter(fout, fieldnames=["step", "epoch", "epoch_step", *(values.keys())])
if write_csv_header:
csv_writer.writeheader()
csv_writer.writeheader()
epoch = (step - 1) // epoch_len
epoch_step = (step - 1) % epoch_len