1、module ‘cv2’ has no attribute ‘TrackerCSRT_create’
Traceback (most recent call last):
File “C:\all\code\pycharm\pytorch\openCV\项目实战\19目标追踪\multi-object-tracking\multi_object_tracking.py”, line 16, in < module>
“csrt”: cv2.TrackerCSRT_create,
AttributeError: module ‘cv2’ has no attribute ‘TrackerCSRT_create’
注意 opencv-python
和 opencv-contrib-python
的版本一致
pip install opencv-contrib-python
可以通过 pip list
进行查看安装库的版本
2、module ‘cv2’ has no attribute ‘TrackerBoosting_create’
新版本中,一些函数被取消
通过cv2.legacy来调用这些函数
将cv2.TrackerBoosting_create
改为cv2.legacy.TrackerBoosting_create
即可
就可以正常运行了
扫描二维码关注公众号,回复:
14595533 查看本文章