title: How to open and select a subset of images from .rec file in python?
body: <p>I have a folder containing the following files: train.idx, train.rec, property, lfw.bin, cfp_fp.bin, agedb_30.bin</p>
  
  <p>This folder contains face images. </p>
  
  <p>I have already used ImageRecordIter in the following code. </p>
  
  <p>However everytime that I print the first element of train_data I get a different image.  </p>
  
  <pre><code>train_data = ImageRecordIter(
      path_imgrec = os.path.join(rec_path,'train.rec'),
      path_imgidx = os.path.join(rec_path, 'train.idx'),
      label_width = 2,
  
      data_shape  = (3,112,112 ),
      batch_size  = 10,
      shuffle     = False)
  </code></pre>
  
  <p>My questions are:</p>
  
  <p>1) I do not know how data is usually stored in these types of files, e.g. which one contains labels. Any idea about these types of files?</p>
  
  <p>2) How can I extract a subset of data to make a sample file? Also, what would be the file format (e.g. pickle file, txt file)?</p>