code: def read_data_from_file(filepath, instances):
      print("Reading SVHN Dataset...")
      mat = scipy.io.loadmat(filepath)
      Y = mat["y"]  ##Y.shape = (instances,1)
      X = mat["X"]  # X.shape = (32, 32, 3, instances) -> 32x32 RGB
      nX = np.zeros(instances * 3 * 32 * 32).reshape(
          instances, 32, 32, 3
      )
      for n in range(instances):
          for rgb in range(3):
              for i in range(32):
                  for j in range(32):
                      nX[n, i, j, rgb] = X[
                          i, j, rgb, n
                      ]  # output shape: (Nx32x32x3)
      nY = np.zeros(instances * 10).reshape(instances, 10)
      for n in range(instances):
          nY[n] = label_to_one_hot_y(Y[n, 0], 10)
      print("   ...dataset read!")
      return nX, nY
  
file_path: tflearn/tflearn/datasets/svhn.py
imports: from __future__ import print_function
  import numpy
  import scipy.io
  from six.moves import urllib
  import os
label_desc: Use image node_id 3 for calling a global function with example usage: read_data_from_file(filepath, instances) and returns: nX,  nY