I have an image dataset and half of them couldn't be encoded using face_encodings() function.
This is one of them:

Firstly, I used load_image_file() and I got a numpy array with shape (182,182,3). There was no problem, but when I use the numpy array I've got with face_encodings(), it return [ ].
That means it didn't find any faces in the image to encode. By default, it tries to locate a face in the image before it encodes it. Since your image is already cropped to the face area, you can pass in known_face_locations=[(0, width, height, 0]] to tell it where the face is.
That seems to work, thank you @ageitgey
Most helpful comment
That means it didn't find any faces in the image to encode. By default, it tries to locate a face in the image before it encodes it. Since your image is already cropped to the face area, you can pass in
known_face_locations=[(0, width, height, 0]]to tell it where the face is.