title: Problems about cPickle library on running CIFAR-10 dataset
body: <p>I am currently following CIFAR-10 example up. Downloaded dataset on <a href="http://www.cs.toronto.edu/~kriz/cifar.html" rel="nofollow">http://www.cs.toronto.edu/~kriz/cifar.html</a> (CIFAR-10 python version). After extracted file, "cifar-10-batches-py" folder came out.</p>
  
  <p>With this folder, I tried to see its dataset. I used the code shown below.</p>
  
  <pre><code>import cPickle
  import os
  import numpy as np
  
  def unpickle(file):
      fo = open(file, 'rb')
      dict = cPickle.load(fo)
      fo.close()
      return dict
  
  def conv_data2image(data):
      return np.rollaxis(data.reshape((3,32,32)),0,3)
  
  def get_cifar10(folder):
      tr_data = np.empty((0,32*32*3))
      tr_labels = np.empty(1)
      '''
      32x32x3
      '''
      for i in range(1,6):
          fname = os.path.join(folder, "%s%d" % ("data_batch_", i))
          data_dict = unpickle(fname)
          if i == 1:
              tr_data = data_dict['data']
              tr_labels = data_dict['labels']
          else:
              tr_data = np.vstack((tr_data, data_dict['data']))
              tr_labels = np.hstack((tr_labels, data_dict['labels']))
  
      data_dict = unpickle(os.path.join(folder, 'test_batch'))
      te_data = data_dict['data']
      te_labels = np.array(data_dict['labels'])
  
      bm = unpickle(os.path.join(folder, 'batches.meta'))
      label_names = bm['label_names']
  
      return tr_data, tr_labels, te_data, te_labels, label_names
  
  
  if __name__ == '__main__':
      datapath = '/Users/sungtegg/Documents/cifar-10-batch.py'
  
      tr_data10, tr_labels10, te_data10, te_labels10, label_names10 = get_cifar10(datapath)
  </code></pre>
  
  <p>After compiling this code, </p>
  
  <pre><code>"IOError: [Errno 2] No such file or directory: '/Users/sungtegg/Documents/cifar-10-batch.py/data_batch_1'
  </code></pre>
  
  <p>this error code came out.</p>
  
  <p>What section of the code got wrong? </p>