batched_iterator: reset i_item after every time

This commit is contained in:
Starbeamrainbowlabs 2022-10-21 15:35:43 +01:00
parent c5b1501dba
commit af26964c6a
Signed by: sbrl
GPG key ID: 1BE5172E637709C2
2 changed files with 3 additions and 2 deletions

View file

@ -16,5 +16,6 @@ def batched_iterator(dataset, tensors_in_item=1, batch_size=64):
if i_item >= batch_size:
yield [ tf.stack(tensors) for tensors in acc ]
i_item = 0
for arr in acc:
arr.clear()
arr.clear()

View file

@ -118,7 +118,7 @@ def do_png(args, ai, dataset, model_code):
i += 1
if i % 100 == 0:
sys.stderr.write(f"Processed {i} items")
sys.stderr.write(f"Processed {i} items\r")
def do_jsonl(args, ai, dataset):
write_mode = "wt" if args.output.endswith(".gz") else "w"