dataset: properly resize

This commit is contained in:
Starbeamrainbowlabs 2022-09-02 17:09:38 +01:00
parent c78b6562ef
commit 9f7f4af784
Signed by: sbrl
GPG key ID: 1BE5172E637709C2

View file

@ -28,8 +28,7 @@ def parse_item(metadata):
rainfall = tf.transpose(rainfall, [1, 2, 0]) rainfall = tf.transpose(rainfall, [1, 2, 0])
# [width, height] → [width, height, channels] # [width, height] → [width, height, channels]
water = tf.expand_dims(water, axis=-1) water = tf.expand_dims(water, axis=-1)
# BUG: AttributeError: 'dict' object has no attribute 'waterdepth rainfall = tf.image.resize(rainfall, tf.cast(tf.constant(metadata["waterdepth"]) / 2, dtype=tf.int32))
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 # 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) print("DEBUG:dataset ITEM rainfall:shape", rainfall.shape, "water:shape", water.shape)