Face Recognition Using HOG+SVM This is my approach

svm = cv2.ml.SVM_create()
svm.setType(cv2.ml.SVM_C_SVC)
svm.setKernel(cv2.ml.SVM_RBF)
svm.trainAuto(data["encodings"], cv2.ml.ROW_SAMPLE,data["names"])


where I get encodings using HOG and names from:

for (i, imagePath) in enumerate(imagePaths):
    # extract the person name from the image path
    print("[INFO] processing image {}/{}".format(i + 1, len(imagePaths)))
    name = imagePath.split(os.path.sep)[-2]


but when I train  


  'samples is not a numpy array, neither a scalar'


this error appears in the line:

svm.trainAuto(data["encodings"], cv2.ml.ROW_SAMPLE,data["names"])


I think I need to convert the names to a numpy array. 

How can I do that?
It's hard to tell exactly what you're asking, and exactly what your data looks like. Nonetheless, I think you're asking how to convert a list to a numpy.array.

Try this:

np.asarray(data["names"])