变得非常困惑。搜索周围但找不到任何有用的帮助。我收到了错误
回溯(最近一次呼叫最后一次):文件“main_test.py”,第105行,中 train(descriptors,image_classes,image_paths)文件“main_test.py”,第40行,在火车上 bow_extract = cv2.BOWImgDescriptorExtractor(descr_ext,matcher)AttributeError:'module'对象没有属性 'BOWImgDescriptorExtractor'
我关注此链接代码: https://www.linkedin.com/pulse/machine-learning-image-detectioncats-vs-dogs-amrith-kumar 但是我无法实现它并且犯了错误。
def train(descriptors,image_classes,image_paths):
flann_params = dict(algorithm = 1, trees = 5)
matcher = cv2.FlannBasedMatcher(flann_params, {})
bow_extract = cv2.BOWImgDescriptorExtractor(descr_ext,matcher)
bow_train = cv2.BOWKMeansTrainer(20)