From c066ea331bd989234433669b86a8f35f3cc07f04 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Fri, 2 Sep 2022 16:07:44 +0100 Subject: [PATCH] =?UTF-8?q?dataset:=20namespace=20=E2=86=92=20dict=20Pytho?= =?UTF-8?q?n=20is=20so=20annoying?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aimodel/src/lib/dataset/dataset.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aimodel/src/lib/dataset/dataset.py b/aimodel/src/lib/dataset/dataset.py index 6420ee7..12585a5 100644 --- a/aimodel/src/lib/dataset/dataset.py +++ b/aimodel/src/lib/dataset/dataset.py @@ -20,13 +20,13 @@ def parse_item(metadata): }) rainfall = tf.io.parse_tensor(parsed["rainfallradar"], out_type=tf.float32) water = tf.io.parse_tensor(parsed["waterdepth"], out_type=tf.float32) - # [channels, width, height] → [width, height, channels] - ref ConvNeXt does not support data_format=channels_first + rainfall = tf.transpose(rainfall, [1, 2, 0]) # [width, height] → [width, height, channels] water = tf.expand_dims(water, axis=-1) # BUG: AttributeError: 'dict' object has no attribute 'waterdepth - rainfall = tf.image.resize(rainfall, tf.constant(metadata.waterdepth)) + rainfall = tf.image.resize(rainfall, tf.constant(metadata["waterdepth"])) # TODO: The shape of the resulting tensor can't be statically determined, so we need to reshape here print("DEBUG:dataset ITEM rainfall:shape", rainfall.shape, "water:shape", water.shape)