-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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: 'NoneType' object is not subscriptable #527
Comments
This question comes up all the time, so I added it to the wiki. Check this out: https://github.com/ageitgey/face_recognition/wiki/Common-Errors#issue-assertion-failed-ssizewidth--0--ssizeheight--0-when-running-the-webcam-examples |
Dear Mr. Ageitgey, People are getting attracted with your articles including me :) i had downloaded image file available @ Download the pre-configured VM image Here is my PC-Configuration Processor: AMD FX 8120 Eight Core 3.10 GHz |
I'm also facing the same error while using VM Traceback (most recent call last): |
same here:
|
rgb_frame = frame[:, :, ::-1] |
Anyone has a solution for this issue? |
Does anybody have a solution????! |
You need to make sure your webcam is working with OpenCV. Your camera isn't returning an image, so you get a NULL image array, causing the error you see. See #21 (comment) |
this worked. |
PS C:\Users\DELL\Documents\FaceRecog_attendaceSystem-main.final> & C:/Users/DELL/AppData/Local/Programs/Python/Python311/python.exe c:/Users/DELL/Documents/FaceRecog_attendaceSystem-main.final/Face_Recognition.py |
if r is None:
if name == "main": |
fix the error |
facerec_from_webcam.py error message
/usr/bin/python3.5 /home/e/Desktop/face_recognition-master/examples/facerec_from_webcam.py
Traceback (most recent call last):
File "/home/e/Desktop/face_recognition-master/examples/facerec_from_webcam.py", line 37, in
rgb_frame = frame[:, :, ::-1]
TypeError: 'NoneType' object is not subscriptable
Note1: "rgb_frame = frame [:,:, :: - 1]" is also available on line 46 of the facerec_from_video_file.py file.
The facerec_from_video_file.py file is working fine
Note2: pip3 install opencv_python
Requirement already satisfied: opencv_python in /usr/local/lib/python3.5/dist-packages (3.4.1.15)
Requirement already satisfied: numpy>=1.11.1 in /usr/local/lib/python3.5/dist-packages (from opencv_python) (1.14.4)
facerec_from_webcam_faster.py error message
Traceback (most recent call last):
File "/home/e/Desktop/face_recognition-master/examples/facerec_from_webcam_faster.py", line 45, in
small_frame = cv2.resize(frame, (0, 0), fx=0.25, fy=0.25)
cv2.error: OpenCV(3.4.1) /io/opencv/modules/imgproc/src/resize.cpp:4044: error: (-215) ssize.width > 0 && ssize.height > 0 in function resize
The text was updated successfully, but these errors were encountered: