title: Dimensions must be equal, but are 1 and 128 for 'SparseSoftmaxCrossEntropyWithLogits
body: <p>I tried to read an images as png format using conventional neural network in tensorflow. I faced a problem that I cannot deal with label in read data step, so, it gives me an error.</p>
  
  <p>First thing I thought the problem is happened when I create <em>batch queue and shuffle</em>.
  which was the problem in <strong>tf.train.shuffle_batch</strong> expected 1-D but actually it got shape as 3-D.</p>
  
  <p>I fixed that. and then it gives me another error in <strong>loss function</strong></p>
  
  <p>The subcode is <a href="https://www.dropbox.com/s/ksgdqtmxd6fa82o/SVHN.py?dl=0" rel="nofollow noreferrer">here</a></p>
  
  <p>the problem is::</p>
  
  <blockquote>
    <blockquote>
      <p>Traceback (most recent call last):   File "SVHN.py", line 280, in 
          tf.app.run()   File "/home/ashwaq/anaconda3/lib/python3.6/site-packages/tensorflow/python/platform/app.py",
      line 48, in run
          _sys.exit(main(_sys.argv[:1] + flags_passthrough))   File "SVHN.py", line 269, in main
          train_op = SVHN_architecture_AND_optimize()   File "SVHN.py", line 203, in SVHN_architecture_AND_optimize
          cross_entropy =  tf.nn.sparse_softmax_cross_entropy_with_logits(logits = logits, labels
      = labels)   File "/home/ashwaq/anaconda3/lib/python3.6/site-packages/tensorflow/python/ops/nn_ops.py",
      line 1742, in sparse_softmax_cross_entropy_with_logits
          precise_logits, labels, name=name)   File "/home/ashwaq/anaconda3/lib/python3.6/site-packages/tensorflow/python/ops/gen_nn_ops.py",
      line 2418, in _sparse_softmax_cross_entropy_with_logits
          features=features, labels=labels, name=name)   File "/home/ashwaq/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py",
      line 768, in apply_op
          op_def=op_def)   File "/home/ashwaq/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/ops.py",
      line 2338, in create_op
          set_shapes_for_outputs(ret)   File "/home/ashwaq/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/ops.py",
      line 1719, in set_shapes_for_outputs
          shapes = shape_func(op)   File "/home/ashwaq/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/ops.py",
      line 1669, in call_with_requiring
          return call_cpp_shape_fn(op, require_shape_fn=True)   File "/home/ashwaq/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/common_shapes.py",
      line 610, in call_cpp_shape_fn
          debug_python_shape_fn, require_shape_fn)   File "/home/ashwaq/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/common_shapes.py",
      line 676, in _call_cpp_shape_fn_impl
          raise ValueError(err.message) ValueError: Dimensions must be equal, but are 1 and 128 for
      'SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits'
      (op: 'SparseSoftmaxCrossEntropyWithLogits') with input shapes: [1,10],
      [128].</p>
    </blockquote>
  </blockquote>