ValueError: Dimensions must be equal, but are 784 and 10 for 'add' (op: 'Add') with input shapes: [784,784], [10].
出现这种错误是由于矩阵位置放错了
#定义两个placeholder
x = tf.placeholder(tf.float32, [None, 784])
y = tf.placeholder(tf.float32, [None, 10])
#神经网络层
weight = tf.Variable(tf.zeros([784, 10]))
bias = tf.Variable(tf.zeros([10]))
predict = tf.matmul(weight, x) + bias
此时需要将predict = tf.matmul(weight, x) + bias改成
predict = tf.matmul(x, weight) + bias