shanren7/real_time_face_recognition

ValueError: shape mismatch: value array of shape (0,1) could not be broadcast to indexing result of shape (0,)

louiseruiwenli opened this issue · 1 comments

OK Despite the version error that I encountered, (I commented the saver.restore line) I now got a new issue:

/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sklearn/base.py:312: UserWarning: Trying to unpickle estimator KNeighborsClassifier from version 0.18.1 when using version 0.19.0. This might lead to breaking code or invalid results. Use at your own risk.
UserWarning)
Traceback (most recent call last):
File "/Users/cnspec/PycharmProjects/tensorflow/real_time_face_recognition/real+time+face+detection+and++recognition.py", line 164, in
bounding_boxes, _ = detect_face.detect_face(img, minsize, pnet, rnet, onet, threshold, factor)
File "/Users/cnspec/PycharmProjects/tensorflow/real_time_face_recognition/detect_face.py", line 348, in detect_face
dy, edy, dx, edx, y, ey, x, ex, tmpw, tmph = pad(total_boxes.copy(), w, h)
File "/Users/cnspec/PycharmProjects/tensorflow/real_time_face_recognition/detect_face.py", line 507, in pad
edx[tmp] = np.expand_dims(-ex[tmp]+w+tmpw[tmp],1)
ValueError: shape mismatch: value array of shape (0,1) could not be broadcast to indexing result of shape (0,)

Anyone know how to solve this?

Haha I solved it. Didn't expect to solve it so fast. It turns out to be the problem in face_detect.py pad function. I replaced the code with @tanjie860110 's code in another issue #1 . Thanks!