title: Face-Recognition: ValueError: Object arrays cannot be loaded when allow_pickle=False
body: <p><a href="https://i.stack.imgur.com/2P0ST.png" rel="nofollow noreferrer">Error ScreenShot</a></p>
  <pre class="lang-py prettyprint-override"><code>def read_array(fp, allow_pickle=False, pickle_kwargs=None):
      version = read_magic(fp)
      _check_version(version)
      shape, fortran_order, dtype = _read_array_header(fp, version)
      if len(shape) == 0:
          count = 1
      else:
          count = numpy.multiply.reduce(shape, dtype=numpy.int64)
  
      # Now read the actual data.
      if dtype.hasobject:
          # The array contained Python objects. We need to unpickle the data.
          **if not allow_pickle:
              raise ValueError(&quot;Object arrays cannot be loaded when &quot;
                               &quot;allow_pickle=False&quot;)**
          if pickle_kwargs is None:
              pickle_kwargs = {}
          try:
              array = pickle.load(fp, **pickle_kwargs)
          except UnicodeError as err:
              # Friendlier error message
              raise UnicodeError(&quot;Unpickling a python object failed: %r\n&quot;
                                 &quot;You may need to pass the encoding= option &quot;
                                 &quot;to numpy.load&quot; % (err,))
      else:
          if isfileobj(fp):
              # We can use the fast fromfile() function.
              array = numpy.fromfile(fp, dtype=dtype, count=count)
          else:
              array = numpy.ndarray(count, dtype=dtype)
  
              if dtype.itemsize &gt; 0:
                  # If dtype.itemsize == 0 then there's nothing more to read
                  max_read_count = BUFFER_SIZE // min(BUFFER_SIZE, dtype.itemsize)
  
                  for i in range(0, count, max_read_count):
                      read_count = min(max_read_count, count - i)
                      read_size = int(read_count * dtype.itemsize)
                      data = _read_bytes(fp, read_size, &quot;array data&quot;)
                      array[i:i+read_count] = numpy.frombuffer(data, dtype=dtype,
                                                               count=read_count)
  
          if fortran_order:
              array.shape = shape[::-1]
              array = array.transpose()
          else:
              array.shape = shape
  
      return array
  </code></pre>