I'm trying to use tfa.image.random_cutout like so:
def random_cut(image):
image_string = tf.io.read_file(image)
image = tf.io.decode_png(image_string, channels=3)
image = tf.cast(image, tf.float32) / 255.
image = tfa.image.random_cutout(image, (64,64), constant_values = 0)
return image
dataset = dataset.map(random_cut)
But it's returning the following error:
ValueError: slice index 3 of dimension 0 out of bounds. for '{{node cutout/strided_slice_2}} = StridedSlice[Index=DT_INT32, T=DT_INT32, begin_mask=0, ellipsis_mask=0, end_mask=0, new_axis_mask=0, shrink_axis_mask=1](cutout/Shape, cutout/strided_slice_2/stack, cutout/strided_slice_2/stack_1, cutout/strided_slice_2/stack_2)' with input shapes: [3], [1], [1], [1] and with computed input tensors: input[1] = <3>, input[2] = <4>, input[3] = <1>.
Any ideas on what I could be doing wrong here?
Cheers.