AttributeError: module 'cv2.face' has no attribute 'createEigenFaceRecognizer' 解决办法

报错 AttributeError: module 'cv2.face' has no attribute 'createEigenFaceRecognizer'

原因:

1.版本问题,目前使用版本cv2.face中createEigenFaceRecognizer更名或移除

解决:请查看对应版本的说明文档,使用对应版本或属性名。

2.未安装

opencv_contrib,所以

model = cv2.face.createEigenFaceRecognizer() 行找不到face

下载地址

https://github.com/opencv/opencv_contrib

或者windows情况下 

https://www.lfd.uci.edu/~gohlke/pythonlibs/

安装对应版本(包含contrib,但是会变动,python在一些版本会把contrib中的包移除到基本包或修改名称)

例如: python3.6+window+64位机器下载

opencv_python‑3.4.2+contrib‑cp36‑cp36m‑win_amd64.whl

opencv_python-3.4.1+contrib-cp36-cp36m-win_amd64.whl

解决:更换版本 

 详细见 http://blog.csdn.net/wyx100/article/details/73008324

 

参考

https://blog.csdn.net/qq_34798152/article/details/78649670

https://stackoverflow.com/questions/46751105/attributeerror-module-cv2-cv2-has-no-attribute-createfisherfacerecognizer

Chances are you are using OpenCV 3.3 and according to their documentation, this module was moved under face. You can access it with cv2.face.FisherFaceRecognizer_create()

可能你使用的是OpenCV 3.3,根据他们的文档,这个模块被移动到了face里面。你可以用

cv2.face.FisherFaceRecognizer_create()来访问它。

  • 2
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值