简体   繁体   English

AttributeError:模块“cv2.cv2”没有属性“TrackerCSRT_create”

[英]AttributeError: module 'cv2.cv2' has no attribute 'TrackerCSRT_create'

AttributeError: module 'cv2.cv2' has no attribute 'TrackerCSRT_create' is thrown. AttributeError: module 'cv2.cv2' has no attribute 'TrackerCSRT_create' 被抛出。

python version: 4.1.1 python 版本:4.1.1

opencv version: 4.1.1 opencv 版本:4.1.1

OS: Linux操作系统:Linux

# init 
tracker = cv2.TrackerCSRT_create() 
success = tracker.init(image, (xmin, ymin, xmax - xmin, ymax - ymin))

The code was working fine till last week.该代码在上周之前运行良好。 I tried to edit my code to create flask app, and encountered this problem upon calling the flask app.我试图编辑我的代码来创建 flask 应用程序,并在调用 flask 应用程序时遇到了这个问题。

update opencv-python and opencv-contrib-python to the latest version via pip3.通过 pip3 将 opencv-python 和 opencv-contrib-python 更新到最新版本。 To note that in my case, both packages were required to resolve the issue.请注意,在我的情况下,两个软件包都需要解决问题。

As per the docs please use:根据文档,请使用:

pip install opencv-contrib-python pip 安装 opencv-contrib-python

"Option 2 - Full package (contains both main modules and contrib/extra modules): pip install opencv-contrib-python (check contrib/extra modules listing from OpenCV documentation)" “选项 2 - 完整的 package(包含主模块和贡献/额外模块):pip 安装 opencv-contrib-python(检查来自 Z5BD4C87976F48E140255E919D 的贡献/额外模块列表)”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 模块“cv2”在 Nvidia Xavier 上没有属性“TrackerCSRT_create” - module 'cv2' has no attribute "TrackerCSRT_create' on Nvidia Xavier AttributeError:模块“cv2.cv2”没有属性“TrackerMOSSE_create” - AttributeError: module 'cv2.cv2' has no attribute 'TrackerMOSSE_create' AttributeError:模块'cv2.cv2'没有属性'SURF_create',2.模块'cv2.cv2'没有属性'xfeatures2d' - AttributeError: module 'cv2.cv2' has no attribute 'SURF_create' , 2. module 'cv2.cv2' has no attribute 'xfeatures2d' AttributeError:模块“cv2.cv2”没有属性“cv” - AttributeError: module 'cv2.cv2' has no attribute 'cv' AttributeError: 模块 'cv2.cv2' 没有属性 'DataFrame' - AttributeError: module 'cv2.cv2' has no attribute 'DataFrame' AttributeError:模块“ cv2.cv2”没有属性面 - AttributeError: module 'cv2.cv2' has no attribute face 属性错误模块 'cv2.cv2' 没有属性 'videocapture' - attributeerror module 'cv2.cv2' has no attribute 'videocapture' AttributeError: 模块 'cv2.cv2' 在 OpenCV 中没有属性 'faces' - AttributeError: module 'cv2.cv2' has no attribute 'faces' in OpenCV AttributeError: 模块“cv2.cv2”没有属性“createLBHFaceRecognizer” - AttributeError: module 'cv2.cv2' has no attribute 'createLBPHFaceRecognizer' AttributeError:模块“cv2.cv2”没有属性“nameWindow” - AttributeError: module 'cv2.cv2' has no attribute 'nameWindow'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM