Search code examples
pythoncvzone

Why does python say that there is an attribute error for cvzone.Classifier()


I am trying to make object recognition in python and I am having this error message come up when I run my code:

AttributeError: module 'cvzone' has no attribute 'Classifier'

This is my code:

import cvzone
import cv2

cap = cv2.VideoCapture(0)
myClassifier = cvzone.Classifier('converted_keras/keras_model.h5','converted_keras/labels.txt')

Can anyone help?


Solution

  • in the 1.5.4 version of cvzone there is no such function called classifier so try installing the 1.3.3 version of cvzone. pip install cvzone==1.3.3.