0
$\begingroup$

I am just trying to assign value to a placeholder but i m am getting error:Cannot feed value of shape () for Tensor 'image_input_22:0', which has shape '(1, 51, 51, 64)'

import numpy as np
import tensorflow as tf
res=np.random.random([1,51,51,64])
image=tf.placeholder(tf.float32,shape=[1,51,51,64],name="image_input")
reshaped_image=tf.reshape(image,[1,51,51,64])
init=tf.global_variables_initializer()
res=0
with tf.Session() as sess:
 sess.run(init)
 res=sess.run(reshaped_image,feed_dict={image:res})
$\endgroup$

1 Answer 1

3
$\begingroup$

You reinitialized res to 0, which is a scalar, hence the error.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.