TensorFlow ValueError Dimensions are not compatible
<p>I have a simple program, mostly copied from the MNIST tutorial on Tensorflow.  I have a 2D array 118 items long, with each subarray being 13 long.  And a 2nd 2D array that is 118 long with a single integer in each sub array, containing either 1, 2, or 3 (the matching class of the first array's item)</p>

<p>Whenever I run it however, I get various dimension errors.</p>

<p>either <code>ValueError: Dimensions X and X are not compatible</code>
or <code>ValueError: Incompatible shapes for broadcasting: (?, 13) and (3,)</code>
or something along those lines.  I've tried most every combination of numbers I can think of here in the various places to get it to align properly but am unable to get it to.</p>

<pre><code>x = tf.placeholder(tf.float32, [None, 13])

W = tf.Variable(tf.zeros([118, 13]))
b = tf.Variable(tf.zeros([3]))

y = tf.nn.softmax(tf.matmul(x, W) + b)
y_ = tf.placeholder(tf.float32, [None, 13])

cross_entropy = tf.reduce_mean(-tf.reduce_sum(y_ * tf.log(y), reduction_indices=[1]))
train_step = tf.train.GradientDescentOptimizer(0.5).minimize(cross_entropy)

init = tf.initialize_all_variables()
sess = tf.Session()
sess.run(init)

for i in range(1000):
    batch_xs = npWineList
    batch_ys = npWineClass
    sess.run(train_step, feed_dict={x: batch_xs, y_: batch_ys})

correct_prediction = tf.equal(tf.argmax(y,1), tf.argmax(y_,1))
accuracy = tf.reduce_mean(tf.cast(correct_prediction, tf.float32))
print(sess.run(accuracy, feed_dict={x: mnist.test.images, y_: mnist.test.labels}))
</code></pre>