title: How to handle "ValueError: Could not find a format to read the specified file in single-image mode"?
body: <p>Source code link: <a href="https://github.com/rndbrtrnd/udacity-deep-learning/blob/master/1_notmnist.ipynb" rel="nofollow noreferrer">https://github.com/rndbrtrnd/udacity-deep-learning/blob/master/1_notmnist.ipynb</a></p>
  <p>I am working with some of the existing code already written to read image's data as part of deep-learning course using ndimage.imread which is depricated and I changed it to imageio.imread to proceed. But I am still facing some issues (I think it is related to bad image's data).</p>
  <p>Initial Code to read image data using ndimage.imread (depreciated). This code does not work as ndimage is depricated from 1.2.0 version of SciPy.</p>
  <pre><code>try:
    image_data = (ndimage.imread(image_file).astype(float) - 
                  pixel_depth / 2) / pixel_depth
    if image_data.shape != (image_size, image_size):
      raise Exception('Unexpected image shape: %s' % str(image_data.shape))
    dataset[image_index, :, :] = image_data
    image_index += 1
  except IOError as e:
    print('Could not read:', image_file, ':', e, '- it\'s ok, skipping.')
  </code></pre>
  <p>I modified it to use imageio.imread</p>
  <pre><code>try:
          # read the image and normalize it
          image_data = (imageio.imread(image_file).astype(float) - pixel_depth/2)/pixel_depth
          if image_data.shape!= (image_size,image_size):
              raise Exception('Unexpected images shape: %s' % str(image_data.shape))
          dataset[image_index,:,:] = image_data
          image_index+=1
      except IOError as e:
          print('could not read the',image_file ,':',e,'hence skipping it.')
  </code></pre>
  <p>Issues description:
  While using imageio.imread, it is throwing the below error:</p>
  <pre><code>ValueError: Could not find a format to read the specified file in single-image mode
  </code></pre>