This is code from the MNIST tutorial:
correct_prediction = tf.equal(tf.argmax(y, 1), y_)
accuracy = tf.reduce_mean(tf.cast(correct_prediction, tf.float32))
print(sess.run(
accuracy, feed_dict={
x: mnist.test.images,
y_: mnist.test.labels
}))
I modelled this for my own neural network:
print(batch_ys.shape)
correct_prediction = tf.equal(y, float_y_)
accuracy = tf.reduce_mean(tf.cast(correct_prediction, tf.float32))
print(sess.run(
accuracy, feed_dict={
x: batch_test_x,
y_: batch_ys
}))
I get an error on the "y_: batch_ys" line saying "TypeError: Cannot interpret feed_dict key as Tensor: Can not convert a int into a Tensor."
The first print statement in my code was to debug this which successfully prints out (2, 11, 1), which is clearly a tensor. Any ideas?
Any help will be greatly appreciated, thanks in advance.