-
Notifications
You must be signed in to change notification settings - Fork 353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: list indices must be integers or slices, not tuple #1
Comments
'label' is two value-> (1, 0.0) first value is subjects label text count , so I change like this -> label_text = subjects[label[0]] it's work. |
Latest versions of OpenCV's predict function returns a changing following
to
should work fine on OpenCV versions which give this error. |
AttributeError Traceback (most recent call last) AttributeError: module 'cv2' has no attribute 'face' |
Use this instead: |
Try to install opencv using: python -m pip install --user opencv-contrib-python |
Preparing data...
Data prepared
Total faces: 23
Total labels: 23
Predicting images...
Traceback (most recent call last):
File "/Users/avadhesh/Downloads/opencv-face-recognition-python-master/OpenCV-Face-Recognition-Python.py", line 329, in
predicted_img1 = predict(test_img1)
File "/Users/avadhesh/Downloads/opencv-face-recognition-python-master/OpenCV-Face-Recognition-Python.py", line 309, in predict
label_text = subjects[label]
TypeError: list indices must be integers or slices, not tuple
Process finished with exit code 1
The text was updated successfully, but these errors were encountered: