From dbf243c7317d6cba0658ab5d16a09166ad0e8538 Mon Sep 17 00:00:00 2001 From: Jim Martens Date: Wed, 22 May 2019 14:39:26 +0200 Subject: [PATCH] Fixed stacking of tensors with different dtypes Signed-off-by: Jim Martens --- src/twomartens/masterthesis/data.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/twomartens/masterthesis/data.py b/src/twomartens/masterthesis/data.py index 54d899d..8a239f7 100644 --- a/src/twomartens/masterthesis/data.py +++ b/src/twomartens/masterthesis/data.py @@ -330,7 +330,6 @@ def _load_images_ssd_callback(resized_shape: Sequence[int]) \ loaded images """ _images = tf.map_fn(lambda path: tf.read_file(path), paths) - image_labels = tf.stack([_images, labels], axis=1) def _get_images(image_data: tf.Tensor, _labels: Sequence[int]) -> Tuple[tf.Tensor, Sequence[int]]: @@ -343,7 +342,7 @@ def _load_images_ssd_callback(resized_shape: Sequence[int]) \ return image_resized, _labels - processed = tf.map_fn(_get_images, image_labels) + processed = tf.map_fn(_get_images, (_images, labels)) processed_images = tf.reshape(processed[:, 0], [-1, resized_shape[0], resized_shape[1], 3]) return processed_images, processed[:, 1]