I'm trying to solve a captcha image I downloaded by editing a code on github

It can read the image it’s just gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) that fails.