Create an int list feature to save as tfrecord in tensorflow?
<p>How can I create a tensorflow record from a list?</p>

<p>From the <a href="https://github.com/tensorflow/tensorflow/blob/r0.9/tensorflow/core/example/feature.proto#L9-10" rel="noreferrer">documentation</a> here it seems possible. There's also this <a href="https://github.com/tensorflow/tensorflow/blob/r0.9/tensorflow/examples/how_tos/reading_data/convert_to_records.py#L64-69" rel="noreferrer">example</a> where they convert a numpy array into a byte array using the <code>.tostring()</code> from numpy. However when I try to pass in:</p>

<pre><code>labels = np.asarray([[1,2,3],[4,5,6]])
...
example = tf.train.Example(features=tf.train.Features(feature={
    'height': _int64_feature(rows),
    'width': _int64_feature(cols),
    'depth': _int64_feature(depth),
    'label': _int64_feature(labels[index]),
    'image_raw': _bytes_feature(image_raw)}))
writer.write(example.SerializeToString())
</code></pre>

<p>I get the error:</p>

<pre><code>TypeError: array([1, 2, 3]) has type type 'numpy.ndarray', but expected one of: (type 'int', type 'long')
</code></pre>

<p>Which doesn't help me to figure out how to store a list of integers into the tfrecord. I've tried looking through the docs.  </p>