I'm not sure what this error means. This error occurs when I try to calculate acc
:
acc = accuracy.eval(feed_dict = {x: batch_images, y: batch_labels, keep_prob: 1.0})
I've tried looking up solutions, but I couldn't find any online. Any ideas on what's causing my error?
Here's a link to my full code.
The source code generating this error reads as follows:
Note that
axis
is required to be less thaninput_dims
, not less-than-or-equal.This conforms with the syntax
[-1,1)
in the message:[
indicates an inclusive value (such that-1
is valid), whereas)
indicates an exclusive value (putting1
itself outside the range).I had a similar error but the problem for me was that I was trying to use argmax on a 1 dimensional vector. So the shape of my label was (50,) and I was trying to do a tf.argmax(y,1) on that when evaluating. The solution reference is Tensorflow: I get something wrong in accuracy
I solved this problem. Check the expression of batch_labels
Hope to be helpful
For code like
which is often used when calculating accuracy, you can change to
according to the source code: