Stable-diffusion webui AttributeError: module ‘cv2.dnn‘ has no attribute ‘DictValue‘

Stable-diffusion webui AttributeError: module ‘cv2.dnn‘ has no attribute ‘DictValue‘,第1张

AttributeError: module 'cv2.dnn' has no attribute 'DictValue'

Stable-diffusion webui 安装了一个插件之后,reload ui失败,进而 bash webui.sh 失败
Stable-diffusion webui AttributeError: module ‘cv2.dnn‘ has no attribute ‘DictValue‘,在这里插入图片描述,第2张
笔者尝试了多种办法,升级 / 卸载,安装 opencv-python,都不能成功
主要原因:stable-diffusion webui内部的venv会在早些时刻就配置好了(前期项目的)环境,现在新增的插件,只能用之前的环境而不能用到最新的 opencv-python
例如在执行下述 *** 作时,stable-diffusion webui 下 venv/lib/python3.8/site-packages/cv2中的version是4.5.5.64,然而我的环境中安装的opencv-python版本是4.8.0.76,(新插件需要用到新版本opencv-python),然后就报错:

AttributeError: module 'cv2.dnn' has no attribute 'DictValue'


解决方式:

  1. 删除 stable-diffusion webui 目录下 _ _pycache_ _文件(如果有的话)
  2. 删除venv文件夹
  3. 重新启动

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/13518113.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-12-28
下一篇 2024-01-03

发表评论

登录后才能评论

评论列表(0条)

保存