title: Using tensorflow TFRecords for a dataset with multi task
body: <p>I want Use <code>TFRecords</code>  for <a href="http://mmlab.ie.cuhk.edu.hk/projects/CelebA.html" rel="nofollow noreferrer">celeba face dataset</a>. celeba face datase has 5 landmark locations, 40 binary attributes annotations per image.</p>
  
  <p><code>TFRecords</code>  only can give one lable. but I want save all this labels in TFRecords.
  How can do this in tensorflow?</p>
  
  <hr>
  
  <p>My solution is :
  I use <a href="https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/how_tos/reading_data/convert_to_records.py#L66" rel="nofollow noreferrer">this</a> to create <code>TFRecords</code> file.
  Then I convert celeba attribute file to <code>.csv</code> and read it by <code>_dataset = pd.read_csv("./List_attr_celeba.csv")</code>.</p>
  
  <p>Then add path to it with <code>_dataset["path"] = './img_align_celeba/' + _dataset["name"]</code>. (I used align images the was in <code>img_align_celeba</code> folder).</p>
  
  <p>for first then features I used <code>labels = _dataset.ix[:,1:11].as_matrix()</code>.</p>
  
  <p>In the code of :</p>
  
  <p><code>example = tf.train.Example(features=tf.train.Features(feature={
          'height': _int64_feature(rows),
          'width': _int64_feature(cols),
          'depth': _int64_feature(depth),
          'label': _int64_feature(int(labels[index])),
  'image_raw': _bytes_feature(image_raw)}))</code></p>
  
  <p>label must be <code>'(&lt;class 'int'&gt;,)</code>, but <code>labels[index]</code>  has type <code>&lt;class 'numpy.ndarray'&gt;</code>.</p>
  
  <p>So I changed:</p>
  
  <p><code>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].tolist()),
                  'image_raw': _bytes_feature(image_bytes)}))
              writer.write(example.SerializeToString())</code></p>
  
  <p>and :</p>
  
  <p><code>def _int64_feature(value):
    if  type(value)!= list:
        value = [value]
    return tf.train.Feature(int64_list=tf.train.Int64List(value=value))</code> </p>