module ‘cv2‘ has no attribute ‘samples‘

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
 in 
----> 1 cascade.load(cv.samples.findFile("/home/wgj/1102/cascade.xml"))

AttributeError: module 'cv2' has no attribute 'samples'

检查一下版本号,现在只有在opencv_python-4.0.0.21中还有了。

pip install opencv-python==4.0.0.21

可能网络慢会报错,多试几次即可

你可能感兴趣的:(问题解决,samples,opencv)