title: LabelEncoder object is not subscriptable
body: <pre><code>from sklearn.preprocessing import LabelEncoder
  from sklearn.svm import SVC
  import argparse
  import pickle
  
  # construct the argument parser and parse the arguments
  ap = argparse.ArgumentParser()
  ap.add_argument("-e", "--embeddings",default=r"C:\Users\osama\Desktop\opencv-face-recognition\face_detection_model\output",
      help="path to serialized db of facial embeddings")
  ap.add_argument("-r", "--recognizer", default=r"C:\Users\osama\Desktop\opencv-face-recognition\face_detection_model\output",
      help="path to output model trained to recognize faces")
  ap.add_argument("-l", "--le", default=r"C:\Users\osama\Desktop\opencv-face-recognition\face_detection_model\output",
      help="path to output label encoder")
  args = vars(ap.parse_args())
  # load the face embeddings
  print("[INFO] loading face embeddings...")
  data = pickle.loads(open(args["embeddings"], "rb").read())
  
  # encode the labels
  
  
  
     print("[INFO] encoding labels...")
      le = LabelEncoder()
      labels = le.fit_transform(data["names"])
  
  # train the model used to accept the 128-d embeddings of the face and
  # then produce the actual face recognition
  
  
   print("[INFO] training model...")
      recognizer = SVC(C=1.0, kernel="linear", probability=True)
      recognizer.fit(data["embeddings"], labels)
  
  # write the actual face recognition model to disk
  f = open(args["recognizer"], "wb")
  f.write(pickle.dumps(recognizer))
  f.close()
  
  #write the label encoder to disk
  f = open(args["le"], "wb")
  f.write(pickle.dumps(le))
  f.close()
  </code></pre>
  
  <p>The Error I get is :</p>
  
  <pre><code>Traceback (most recent call last):
  
    File "&lt;ipython-input-6-f2ad45651de8&gt;", line 1, in &lt;module&gt;
      runfile('C:/Users/osama/Desktop/untitled1.py', wdir='C:/Users/osama/Desktop')
  
    File "C:\Users\osama\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 827, in runfile
      execfile(filename, namespace)
  
    File "C:\Users\osama\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile
      exec(compile(f.read(), filename, 'exec'), namespace)
  
    File "C:/Users/osama/Desktop/untitled1.py", line 28, in &lt;module&gt;
      labels = le.fit_transform(data["names"])
  
  TypeError: 'LabelEncoder' object is not subscriptable
  </code></pre>
  
  <p>I trying to label the names and get this error. What could be done?</p>