title: Numpy only integer scalar arrays can be converted to a scalar index - Upgrading to 3.6
body: <p>So I'm reading in the <code>.flo</code> as I do some warping. Seems I have no issue with Python2.7 and numpy version 1.11.2, but when I upgrade to Python3.6 and numpy version 1.12.0.</p>
  
  <p>But during the conversion, I know get an error <code>only integer scalar arrays can be converted to a scalar index</code> for the line <code>data2d = np.fromfile(f, np.float32, count=2 * w * h)</code></p>
  
  <pre><code>import numpy as np
  
  
  def read_flow(filename):
          f = open(filename, 'rb')
          magic = np.fromfile(f, np.float32, count=1)
          data2d = None
  
          if 202021.25 != magic:
              print('Magic number incorrect. Invalid .flo file')
          else:
              w = np.fromfile(f, np.int32, count=1)
              h = np.fromfile(f, np.int32, count=1)
              print("Reading %d x %d flo file" % (h, w))
              data2d = np.fromfile(f, np.float32, count=2 * w * h)
              # reshape data into 3D array (columns, rows, channels)
              data2d = np.resize(data2d, (h, w, 2))
          f.close()
          return data2d
  </code></pre>
  
  <p>Example <code>.flo</code> file can be obtained <a href="https://github.com/liruoteng/OpticalFlowToolkit/blob/master/data/example/flow_gt.flo" rel="nofollow noreferrer">here</a></p>