yolov5中The size of tensor a (80) must match the size of tensor b (56) at non-singleton dimension 3

在这里插入图片描述
在运行yolov5时这里报错:The size of tensor a (80) must match the size of tensor b (56) at non-singleton dimension 3
这是由于你使用的yolov5版本是5.0但是你的pt文件不是5.0的,两者要对应。

下载
https://github.com/ultralytics/yolov5/releases/download/v5.0/yolov5s.pt
替换代码中原来的yolov5s.pt就好了

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
这个错误是由于张量a和张量b的尺寸不匹配导致的。根据引用和引用的信息,张量a的尺寸为80,而张量b的尺寸为56。在维度3上,它们的尺寸必须匹配,即8056必须相等。否则,就会触发这个错误。 解决这个问题的方法有多种,具体取决于你的代码和应用场景。引用提供了一种可能的解决方案,但没有提供具体的细节。你可以尝试以下几种方法来解决这个问题: 1. 检查你的代码涉及到张量a和张量b的部分,确保它们的维度和尺寸是一致的。 2. 如果你使用的是预训练模型,确保输入数据的尺寸与模型期望的尺寸相匹配。 3. 如果你在自定义模型或网络使用了这些张量,可以考虑调整模型的结构或处理方法,以确保张量的尺寸一致。 总之,你需要仔细检查你的代码,并确保所有涉及到张量a和张量b的操作都具有一致的尺寸。这样就可以避免这个错误的发生。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* [yolov5-5.0编译时存在问题](https://blog.csdn.net/chlyrx/article/details/125693973)[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^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"] - *3* [RuntimeError: The size of tensor a (80) must match the size of tensor b (56) at non-singleton](https://blog.csdn.net/weixin_44363167/article/details/123618125)[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^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值