title: cPickle.UnpicklingError: invalid load key, ' '.?
body: <p>I am trying to use the <a href="http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gz" rel="nofollow">mnist_data</a> for hand written digit recognition.Now i tried this code to load the data.</p>
  
  <pre><code>import cPickle
  import numpy as np
  
  
  def load_data():
      f = open('G:/thesis paper/data sets/mnist.pkl.gz', 'rb')
      training_data, validation_data, test_data = cPickle.load(f)
      f.close()
      return (training_data, validation_data, test_data)
  
  
  def load_data_nn():
      training_data, validation_data, test_data = load_data()
      inputs = [np.reshape(x, (784, 1)) for x in training_data[0]]
      results = [vectorized_result(y) for y in training_data[1]]
      training_data = zip(inputs, results)
      test_inputs = [np.reshape(x, (784, 1)) for x in test_data[0]]
      return (training_data, test_inputs, test_data[1])
  
  
  def vectorized_result(j):
      e = np.zeros((10, 1))
      e[j] = 1.0
      return e
  
  
  if __name__ == '__main__':
      tr_data,test_inp,test_data=load_data_nn()
  </code></pre>
  
  <p>But i am getting this error.</p>
  
  <pre><code>   File "D:/NeuralNet/mnist_loader.py", line 42, in load_data
       training_data, validation_data, test_data = cPickle.load(f) cPickle.UnpicklingError: invalid load key, ''.
  </code></pre>
  
  <p>I couldn't understand what the error is trying to say and how to remove this error..Thanks in advance..</p>