title: TensorFlow: TypeError: Expected int64, got list containing Tensors of type '_Message' instead
body: <p>My TensorFlow version is 1.0.
  When I run the following code:</p>
  
  <pre><code>train_file='~/tf_code/train'
  filename_queue = tf.train.string_input_producer([train_file],num_epochs=None)
  reader = tf.TFRecordReader()
  _, ex = reader.read(filename_queue)
  
  sequence_features = {
      "x":tf.FixedLenSequenceFeature([], dtype = tf.int64),
      "tomatch_indices_1D":tf.FixedLenSequenceFeature([], dtype = tf.int64)
  }
  
  context_parsed, sequence_parsed = tf.parse_single_sequence_example(
      serialized=ex,
      context_features={},
      sequence_features=sequence_features
  )   
  
  indices = tf.cast(sequence_parsed['tomatch_indices_1D'],tf.int64)
  indices = tf.reshape(indices, (-1,3))
  x = sequence_parsed['x']
  lens = tf.shape(x)[0]
  tomatch_sparse = tf.SparseTensor(indices, tf.ones((tf.shape(indices)[0],)), 
      dense_shape=(lens,lens,lens))
  tomatch = tf.sparse_tensor_to_dense(tomatch_sparse, validate_indices=False)
  print(tomatch)
  </code></pre>
  
  <p>Then I got this error on tf.SparseTensor():</p>
  
  <pre><code>Traceback (most recent call last):
    File "/Users/qingping/tf_code/SequenceExample/example_test.py", line 284, in &lt;module&gt;
      stack_test()
    File "/Users/qingping/tf_code/SequenceExample/example_test.py", line 276, in stack_test
      tomatch_sparse = tf.SparseTensor(indices, tf.ones((tf.shape(indices)[0],)), dense_shape=(lens,lens,lens))
    File "/usr/local/lib/python2.7/site-packages/tensorflow/python/framework/sparse_tensor.py", line 127, in __init__
      dense_shape, name="dense_shape", dtype=dtypes.int64)
    File "/usr/local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 637, in convert_to_tensor
      as_ref=False)
    File "/usr/local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 702, in internal_convert_to_tensor
      ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
    File "/usr/local/lib/python2.7/site-packages/tensorflow/python/framework/constant_op.py", line 110, in _constant_tensor_conversion_function
      return constant(v, dtype=dtype, name=name)
    File "/usr/local/lib/python2.7/site-packages/tensorflow/python/framework/constant_op.py", line 99, in constant
      tensor_util.make_tensor_proto(value, dtype=dtype, shape=shape, verify_shape=verify_shape))
    File "/usr/local/lib/python2.7/site-packages/tensorflow/python/framework/tensor_util.py", line 367, in make_tensor_proto
      _AssertCompatible(values, dtype)
    File "/usr/local/lib/python2.7/site-packages/tensorflow/python/framework/tensor_util.py", line 302, in _AssertCompatible
      (dtype.name, repr(mismatch), type(mismatch).__name__))
  TypeError: Expected int64, got list containing Tensors of type '_Message' instead.
  </code></pre>
  
  <p>If I want to build SparseTensor by read data(indices) from file, and the dense_shape of SparseTensor is varied, what should I do? Thanks!</p>