Skip to content

Commit d0c5776

Browse files
author
Alex Biddulph
authored
Fix data shape for classification images (#9)
Data argument (https://www.tensorflow.org/api_docs/python/tf/summary/image#arguments) for `tf.summary.image` expects data to have the shape `[k, h, w, c]`
1 parent cd9d08e commit d0c5776

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

training/callbacks/classification_images.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,4 +121,4 @@ def on_epoch_end(self, epoch, logs=None):
121121
# Sort by hash so the images show up in the same order every time
122122
with self.writer.as_default():
123123
for i, img in enumerate(sorted(images, key=lambda image: image[0])):
124-
tf.summary.image("images/{}".format(i), tf.expand_dims(img[1], axis=-1), step=epoch, max_outputs=1)
124+
tf.summary.image("images/{}".format(i), tf.expand_dims(img[1], axis=0), step=epoch, max_outputs=1)

0 commit comments

Comments
 (0)