Tensorflow error using tf.image.random : 'numpy.ndarray' object has no attribute 'get_shape'

前端 未结 1 575
感情败类
感情败类 2021-01-06 09:48

Intro

I am using a modified version of the Tensorflow tutorial \"Deep MNIST for experts\" with the Python API for a medical images classification pr

相关标签:
1条回答
  • 2021-01-06 10:09

    This seems like an inconsistency in the TensorFlow API, since almost all other op functions accept NumPy arrays wherever a tf.Tensor is expected. I've filed an issue to track the fix.

    Fortunately, there is a simple workaround, using tf.convert_to_tensor(). Replace your code with the following:

    flipped_images = tf.image.random_flip_left_right(tf.convert_to_tensor(images))
    
    0 讨论(0)
提交回复
热议问题