Why do I get a ValueError ('\' image \ 'must be fully defined.') When converting an image to Tensorflow?

I want to increase the amount of data in real time by combining various image transformation operators in a tensor stream. My code starts by decoding images, and then various transformations are performed, but it throws ValueError('\'image\' must be fully defined.'). Here is an example to reproduce this error:

def decode_and_augment(image_raw):
  decoded = tf.image.decode_jpeg(image_raw)
  flipped = tf.image.random_flip_left_right(decoded)
  return flipped
+4
source share
1 answer

- , tf.image.random_flip_left_right() op , tf.image.decode_jpeg() , image_raw, . - decoded, Tensor.set_shape(), :

decoded = tf.image.decode_jpeg(image_raw)
decoded.set_shape([IMAGE_HEIGHT, IMAGE_WIDTH, NUM_CHANNELS])
flipped = tf.image.random_flip_left_right(decoded)

, ( ).

, TensorFlow ( , , ). , , .

+11

Source: https://habr.com/ru/post/1623948/


All Articles