mirror of
https://github.com/sbrl/research-rainfallradar
synced 2024-11-22 09:13:01 +00:00
batched_iterator: reset i_item after every time
This commit is contained in:
parent
c5b1501dba
commit
af26964c6a
2 changed files with 3 additions and 2 deletions
|
@ -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()
|
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue