I am trying to convert tensor of an image which is of shape(253,223) to numpy array of the same size so that I can plot the image. I have looked at the documentation and they suggested me to use the eval function as
sess = tf.Session()
with sess.as_default():
print(type(tf.constant([img1]).eval()))
but it throws the error "List of Tensors when single Tensor expected".
Here type(img1) is
<class 'tensorflow.python.framework.ops.Tensor'>
and shape is (253, 223) . Using keras
tf.keras.backend.eval(x)
it throws
InvalidArgumentError: Input to DecodeRaw has length 56419 that is not a multiple of 4, the size of float [[{{node DecodeRaw}}]] error.
How can I convert given tensor to numpy array of the same dimension?