title: Cannot reshape array of size into shape
body: <p>I am following a machine learning video on youtube at <a href="https://www.youtube.com/watch?v=lbFEZAXzk0g" rel="noreferrer">https://www.youtube.com/watch?v=lbFEZAXzk0g</a>. The tutorial is in python2 so I need to convert it into python3. Here is the section of the code I am having an error with:</p>
  
  <pre class="lang-py prettyprint-override"><code>def load_mnist_images(filename):
      if not os.path.exists(filename):
          download(filename)
      with gzip.open(filename,'rb') as file:
          data = numpy.frombuffer(file.read(),numpy.uint8, offset=16)
          data = data.reshape(-1,1,28,28)
          return data/numpy.float32(256)
  </code></pre>
  
  <p>I am getting this error:
  <code>ValueError: cannot reshape array of size 9992 into shape (1,28,28).</code> How do I fix this? In the tutorial it was working. Also, if I have any other errors please tell me.</p>