Unable to load harr cascade file for frontal eye

Unable to load harr cascade file for frontal eye
while loading it is showing this error
cv2.error: OpenCV(4.2.0) C:\projects\opencv-python\opencv\modules\objdetect\src\cascadedetect.cpp:569: error: (-2:Unspecified error) in function ‘bool _thiscall cv::HaarEvaluator::Feature::read(const class cv::FileNode &,const class cv::Size &)’

Invalid HAAR feature (expected: ‘rw.r.x + rw.r.width <= W’), where
‘rw.r.x + rw.r.width’ is 22
must be less than or equal to
‘W’ is 16

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “copy.py”, line 7, in
eyes_cascade = cv2.CascadeClassifier(‘frontalEyes35x16.xml’)
SystemError: <class ‘cv2.CascadeClassifier’> returned a result with an error set

same problem with nose cascade file

follow these steps and i will get you out of this:
step 1: uninstall the current version of opencv in your laptop
step 2: install the following version of opencv using command
pip install opencv-python==4.0.0.21
and you are good to go ahead

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

ERROR: Could not find a version that satisfies the requirement opencv-python==4.0.0.21 (from versions: 3.4.8.29, 3.4.9.31, 3.4.9.33, 3.4.10.35, 3.4.10.37, 3.4.11.39, 3.4.11.41, 3.4.11.43, 4.1.2.30, 4.2.0.32, 4.2.0.34, 4.3.0.36, 4.3.0.38, 4.4.0.40, 4.4.0.42, 4.4.0.44) ERROR: No matching distribution found for opencv-python==4.0.0.21

Hello @adityaanand47, pls try using version 4.2.0.32 or 4.2.0.34

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.