jkschin
jkschin

Reputation: 5844

TensorFlow CIFAR10 Example

I am trying to run the entire CIFAR10 as is, with data from SVHN.

http://ufldl.stanford.edu/housenumbers/

I formatted the data in the exact format as the bin file from Alex Krizhevsky's website.

http://www.cs.toronto.edu/~kriz/cifar.html

I did not edit the code, other than changing a few variable names to make it work in another directory. It gives me an error now.

W tensorflow/core/common_runtime/executor.cc:1076] 0x218fec0 Compute status: Invalid argument: Indices are not valid (out of bounds).  Shape: dim { size: 128 } dim { size: 10 }
 [[Node: SparseToDense = SparseToDense[T=DT_FLOAT, Tindices=DT_INT32, _device="/job:localhost/replica:0/task:0/cpu:0"](concat, SparseToDense/output_shape, SparseToDense/sparse_values, SparseToDense/default_value)]]

Specifically, the line that fails in cifar.py is:

dense_labels = tf.sparse_to_dense(concated,[FLAGS.batch_size, NUM_CLASSES],1.0, 0.0)

I have checked this solution too, it does not work.

TensorFlow Indices are not valid (out of bounds)

Anyone has any idea on how to make it work?

Upvotes: 3

Views: 3280

Answers (1)

jkschin
jkschin

Reputation: 5844

I realized the mistake. The SVHN dataset gave the number 0 a value of 10, instead of 0. I made this fatal assumption from the start and it wasted a lot of my time.

Given 10 classes, the labels should range from 0-9, inclusive. The error happened because the labels ranged from 1-10.

http://ufldl.stanford.edu/housenumbers/

Do remember to read overviews in future!

Upvotes: 4

Related Questions