将yolov8-face里的模型导出到指定opset11

文章讲述了在使用yolov8-face时遇到的错误,包括Tensor类型不匹配、torch版本问题以及AttributeError关于StemBlock的引用。提供了通过pip安装特定版本和调整模块路径的解决方法。
摘要由CSDN通过智能技术生成

https://github.com/derronqi/yolov8-face


解决办法:

1. 导出前

1 报错内容

  • (Tensor input, Tensor weight, Tensor bias, tuple of ints stride, tuple of ints padding, tuple of ints dilation, int groups)
    didn't match because some of the arguments have invalid types: (Tensor, Parameter, NoneType, tuple, tuple, tuple, int)

解决办法: 

pip install torch==1.8.1 torchvision==0.9.1 torchaudio==0.8.1 -i https://pypi.doubanio.com/simple

解决办法来自于:https://github.com/we0091234/yolov8-plate/issues/2

2. 指定版本

pip install ultralytics==8.0.134 -i https://pypi.tuna.tsinghua.edu.cn/simple

版本来自于 :xxx/yolov8-face/ultralytics/__init__.py

3. 报错内容: AttributeError: Can't get attribute 'StemBlock' on <module 'ultralytics.nn.modules.......

copy :
xxx\yolov8-face\ultralytics\nn\modules\block.py
xxx\yolov8-face\ultralytics\nn\modules\__init__.py
to :
xxx\anaconda\envs\yolov8\Lib\site-packages\ultralytics\nn\modules\block.py
xxx\anaconda\envs\yolov8\Lib\site-packages\ultralytics\nn\modules\__init__.py

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值