I'm using my own data with tensorflow
MNIST
example pipeline but getting:
ValueError: input has 16384 elements, which isn't divisible by 65536
I've been practicing with the example' data successfully. However, after introducing my own images which I resized to 128x128px
and generated ubytes idx files, I get the following error:
Traceback (most recent call last): File "tensorimage.py", line 132, in train_step = tf.train.AdamOptimizer(1e-4).minimize(cross_entropy) File "/home/ubuntu/tensorflow/python3/lib/python3.4/site-packages/tensorflow/python/training/optimizer.py", line 196, in minimize grad_loss=grad_loss) File "/home/ubuntu/tensorflow/python3/lib/python3.4/site-packages/tensorflow/python/training/optimizer.py", line 253, in compute_gradients colocate_gradients_with_ops=colocate_gradients_with_ops) File "/home/ubuntu/tensorflow/python3/lib/python3.4/site-packages/tensorflow/python/ops/gradients.py", line 478, in gradients in_grads = _AsList(grad_fn(op, *out_grads)) File "/home/ubuntu/tensorflow/python3/lib/python3.4/site-packages/tensorflow/python/ops/array_grad.py", line 298, in _ReshapeGrad return [array_ops.reshape(grad, array_ops.shape(op.inputs[0])), None] File "/home/ubuntu/tensorflow/python3/lib/python3.4/site-packages/tensorflow/python/ops/gen_array_ops.py", line 1758, in reshape name=name) File "/home/ubuntu/tensorflow/python3/lib/python3.4/site-packages/tensorflow/python/framework/op_def_library.py", line 703, in apply_op op_def=op_def) File "/home/ubuntu/tensorflow/python3/lib/python3.4/site-packages/tensorflow/python/framework/ops.py", line 2319, in create_op set_shapes_for_outputs(ret) File "/home/ubuntu/tensorflow/python3/lib/python3.4/site-packages/tensorflow/python/framework/ops.py", line 1711, in set_shapes_for_outputs shapes = shape_func(op) File "/home/ubuntu/tensorflow/python3/lib/python3.4/site-packages/tensorflow/python/ops/array_ops.py", line 1867, in _ReshapeShape (num_elements, known_elements)) ValueError: input has 16384 elements, which isn't divisible by 65536
What's confusing to me is, I did indeed set the input to 16384 elements (128x128), however, I don't understand where 65536 came from. I combed through all of the code including the file tensorflow/python3/lib/python3.4/site-packages/tensorflow/contrib/learn/python/learn/datasets/mnist.py
but can't find where 65536 number came from.
It's hard to tell without seeing more of your code exactly what's going wrong, but the summary is that TensorFlow thinks that the other dimensions of input
result in a stride of 65536 elements, and so it's trying to infer the missing dimension by dividing the number of elements present by the known dimensions size, and spotting an error:
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/ops/array_ops.py#L1702
What happens if you print the size of input
just before this error?