title: how can I save a string data to TFRecord?
body: <p>when save to TFRecord, I use:</p>
  
  <pre><code>def _int64_feature(value):
      return tf.train.Feature(int64_list=tf.train.Int64List(value=[value]))
  
  
  def _bytes_feature(value):
      return tf.train.Feature(bytes_list=tf.train.BytesList(value=[value]))
  
  
  def _float_feature(value):
      return tf.train.Feature(float_list=tf.train.FloatList(value=value))
  </code></pre>
  
  <p>and</p>
  
  <pre><code>one_example = tf.train.Example(
      features=tf.train.Features(
          feature={
              "image": _bytes_feature(img.tobytes()),
              "label": _bytes_feature(label.tobytes()),
              "file_name": _bytes_feature(this_city_file_name), #this line doesn't work
              "nb_rows": _int64_feature(nb_rows), 
              "nb_cols": _int64_feature(nb_cols), 
              "index_i": _int64_feature(i), 
              "index_j": _int64_feature(j),
          }
      )
  )
  </code></pre>
  
  <p>and <strong>this_city_file_name</strong> has a type of string
  when I ran this code, that result in an error:</p>
  
  <p><strong>TypeError: 'xxxxxxx' has type , but expected one of: ((,),)</strong></p>
  
  <p>simply use bytes(this_city_file_name) will also result an error:</p>
  
  <p><strong>TypeError: string argument without an encoding</strong></p>
  
  <p>when load from TFRecord, I use</p>
  
  <pre><code>features = tf.parse_single_example(serialized_example,
                                     features={
                                         "image": tf.FixedLenFeature([], tf.string),
                                         "label": tf.FixedLenFeature([], tf.string),
                                         "file_name": tf.FixedLenFeature([], tf.string),
                                         "nb_rows": tf.FixedLenFeature([], tf.int64),
                                         "nb_cols": tf.FixedLenFeature([], tf.int64),
                                         "index_i": tf.FixedLenFeature([], tf.int64),
                                         "index_j": tf.FixedLenFeature([], tf.int64),
                                     },
                                     )
  </code></pre>
  
  <p>I know how to save int and np.array type to and read from TFRecord 
  But how can I save and load <strong>string</strong> data from TFRecord?</p>