I am trying to run
zzz = tf.contrib.image.rotate(image, 0.0348, interpolation='NEAREST')
but getting the error:
ValueError Traceback (most recent call last) in () 5 6 ----> 7 zzz = tf.contrib.image.rotate(image, 0.0348, interpolation='NEAREST') 8 9 # zz = []
/usr/local/lib/python3.6/dist-packages/tensorflow/contrib/image/python/ops/image_ops.py in rotate(images, angles, interpolation, name) 88 images, 89 angles_to_projective_transforms(angles, image_height, image_width), ---> 90 interpolation=interpolation) 91 if image_or_images.get_shape().ndims is None: 92 raise TypeError("image_or_images rank must be statically known")
/usr/local/lib/python3.6/dist-packages/tensorflow/contrib/image/python/ops/image_ops.py in transform(images, transforms, interpolation, output_shape, name) 273 if output_shape is None: 274 output_shape = tensor_util.constant_value( --> 275 array_ops.shape(images)[1:3]) or array_ops.shape(images)[1:3] 276 277 output_shape = ops.convert_to_tensor(
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
What am I missing?
Update:
I am using Tensorfloe 1.12.0 on google collab. running below code gives same error
image = np.zeros((50, 90, 3)); tf.contrib.image.rotate(image, .3)
This error message comes when eager ex. is enabled with tf.enable_eager_execution()