RuntimeError: The size of tensor a (80) must match the size of tensor b (56) at non-singleto解决方法

原因就是下载的权重文件版本不对,如果不是从官方v5.0下面下载的权重文件,那么很大概率出这个问题,哪怕直接运行detect.py下载的也不是正确版本,下图才是最正确下载权重文件的位置,附网址:Releases · ultralytics/yolov5 (github.com)

找到v5.0版本,在Assets里下载对应的权重文件

如果github打开总是出错又找不到科学上网的方法,建议使用watt toolkit,之前只用这个来加速steam,所以也叫steam++,偶然看到还可以加速github,虽然有点慢但至少能进去。

附watt toolkit网址:瓦特工具箱(Steam++官网) - Watt Toolkit (steampp.net)

对于官网下载慢的问题,建议右键要下载的文件 --- 复制链接 --- 在迅雷新建下载任务,相比于Edge几十kb的下载速度,迅雷几百kb还是下载的比较快的。

如果你的迅雷下载到一半下载速度卡住了,可以试用一下1min的会员加速,十几秒就下完了hh

我这边已经下好而且跑完了,有偷懒的同学可以直接从网盘下载,包含yolov5s.pt,yolov5m.pt,yolov5l.pt和yolov5x.pt   这几个权重文件只是v5 5.0版本的,别的版本能不能用我不知道。

链接:https://pan.baidu.com/s/1uO7Q29sQihndj71I9cMQBg?pwd=6666 
提取码:6666 
--来自百度网盘超级会员V4的分享

引用\[1\]和\[2\]提到了类似的错误信息,即"RuntimeError: The size of tensor a (4) must match the size of tensor b (2) at non-singleton dimension 1"和"RuntimeError: The size of tensor a (4) must match the size of tensor b (3) at non-singleton dimension 0"。这些错误通常是由于维度信息不匹配导致的。引用\[2\]中提供了一个解决办法,即将图像转换为RGB格式。因此,对于你的问题"RuntimeError: The size of tensor a (84) must match the size of tensor b (56) at non-singleton dimension 3",你可以尝试将图像转换为RGB格式来解决这个问题。 #### 引用[.reference_title] - *1* [RuntimeError: The size of tensor a (4) must match the size of tensor b (2) at non-singleton dimensio](https://blog.csdn.net/weixin_44337238/article/details/124293003)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [报错解决——RuntimeError: The size of tensor a (4) must match the size of tensor b (3) at non-...](https://blog.csdn.net/Williamcsj/article/details/125746752)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [RuntimeError: The size of tensor a (4) must match the size of tensor b (3) at non-singleton dimensio](https://blog.csdn.net/weixin_46135327/article/details/130805823)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值