This commit is contained in:
Starbeamrainbowlabs 2022-11-11 18:03:09 +00:00
parent 3313f77c88
commit 3a3f7e85da
Signed by: sbrl
GPG key ID: 1BE5172E637709C2

View file

@ -46,7 +46,7 @@ def parse_item(metadata, shape_water_desired, dummy_label=True):
return tf.function(parse_item_inner) return tf.function(parse_item_inner)
def make_dataset(filepaths, metadata, shape_watch_desired=[100,100], compression_type="GZIP", parallel_reads_multiplier=1.5, shuffle_buffer_size=128, batch_size=64, dummy_label=True, prefetch=True, shuffle=True): def make_dataset(filepaths, metadata, shape_water_desired=[100,100], compression_type="GZIP", parallel_reads_multiplier=1.5, shuffle_buffer_size=128, batch_size=64, dummy_label=True, prefetch=True, shuffle=True):
if "NO_PREFETCH" in os.environ: if "NO_PREFETCH" in os.environ:
logger.info("disabling data prefetching.") logger.info("disabling data prefetching.")
@ -56,7 +56,7 @@ def make_dataset(filepaths, metadata, shape_watch_desired=[100,100], compression
) )
if shuffle: if shuffle:
dataset = dataset.shuffle(shuffle_buffer_size) dataset = dataset.shuffle(shuffle_buffer_size)
dataset = dataset.map(parse_item(metadata, shape_water_desired=shape_watch_desired, dummy_label=dummy_label), num_parallel_calls=tf.data.AUTOTUNE) dataset = dataset.map(parse_item(metadata, shape_water_desired=shape_water_desired, dummy_label=dummy_label), num_parallel_calls=tf.data.AUTOTUNE)
if batch_size != None: if batch_size != None:
dataset = dataset.batch(batch_size, drop_remainder=True) dataset = dataset.batch(batch_size, drop_remainder=True)