import tensorflow as tf
import random
import numpy as np
x = tf.placeholder('float')
x = tf.reshape(x, [-1,28,28,1])
with tf.Session() as sess:
x1 = np.asarray([random.uniform(0,1) for i in range(784)])
result = sess.run(x, feed_dict={x: x1})
print(result)
I had some problems using mnist data on reshaping, but this question is simplified version of my problem... Why actually isn't this code working?
It shows
"ValueError: Cannot feed value of shape (784,) for Tensor 'Reshape:0', which has shape '(?, 28, 28, 1)' ".
How could I solve it?