module ‘cv2‘ has no attribute ‘samples‘

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-8-cd7705adf4e1> in <module>
----> 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

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

猜你喜欢

转载自blog.csdn.net/weixin_45885232/article/details/109450707