I am trying to convert a tensor of the following size
<tf.Tensor ‘Reshape:0’ shape=(256, 256, 3) dtype=float32>
to a numpy array, in order to access pixel spatial location using the following:
data_vol = tf.reshape(data_vol, raw_size)
sess = tf.Session()
sess.run(image_tensor)
where data_vol is the image of shape [256,256,3].
But the session keep running forever and it is stuck.
I am using tensorflow 1.6.
But when the image is in the following format:
Tensor(“Const_8:0”, shape=(380, 380, 2), dtype=float32)
It is working fine. The only thing different is that the top one has “Reshape” and this one has Const_8, so I was wondering if this make any difference in the tensor shape and dimension.
I would like to find a solution for the session problem. Highly appreciated.