ai: fix embed i/o

This commit is contained in:
Starbeamrainbowlabs 2022-09-16 16:02:27 +01:00
parent ed94da7492
commit 1e35802d2b
Signed by: sbrl
GPG key ID: 1BE5172E637709C2
2 changed files with 2 additions and 2 deletions

View file

@ -90,7 +90,7 @@ class RainfallWaterContraster(object):
i_batch = -1
for batch in batched_iterator(dataset, tensors_in_item=2, batch_size=self.batch_size):
i_batch += 1
rainfall = self.model_predict.predict(batch[0]) # ((rainfall, water), dummy_label)
rainfall = self.model_predict(batch[0], training=False) # ((rainfall, water), dummy_label)
for step in tf.unstack(rainfall, axis=0):
yield step

View file

@ -64,7 +64,7 @@ def run(args):
handle = sys.stdout
if filepath_output != "-":
handle = handle_open(filepath_output, "w")
handle = handle_open(filepath_output, "wt" if filepath_output.endswith(".gz") else "w")
i = 0
for rainfall in ai.embed(dataset):