news 2026/6/10 21:00:43

GSConv+VoVGSCSP(Slimneck报错修正)

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
GSConv+VoVGSCSP(Slimneck报错修正)

参考有温度的AI提供的Slimneck代码进行的报错修改:

链接:YOLOv5改进之YOLOv5+GSConv+Slim Neck_vovgscsp-CSDN博客

报错:

TypeError: conv2d() received an invalid combination of arguments - got (Tensor, Parameter, NoneType, tuple, tuple, tuple, int), but expected one of:
* (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)
* (Tensor input, Tensor weight, Tensor bias, tuple of ints stride, str 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)

修正:

将GSConv部分的代码替换如下,其他保持不变。

class GSConv(nn.Module):
def __init__(self, c1, c2, k=1, s=1, g=1, act=True):
super().__init__()
c_ = c2 // 2
self.cv1 = Conv(c1, c_, k, s, None, g, 1,act)
self.cv2 = Conv(c_, c_, 5, 1, None, c_,1, act)

def forward(self, x):
x1 = self.cv1(x)
x2 = torch.cat((x1, self.cv2(x1)), 1)
# shuffle
b, n, h, w = x2.data.size()
b_n = b * n // 2
y = x2.reshape(b_n, 2, h * w)
y = y.permute(1, 0, 2)
y = y.reshape(2, -1, n // 2, h, w)
return torch.cat((y[0], y[1]), 1)

版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/6/10 20:56:34

深度解析ReVanced Patches:Android应用补丁技术的3大核心机制

深度解析ReVanced Patches:Android应用补丁技术的3大核心机制 【免费下载链接】ravanced-patches 🧩 Patches for ReVanced 项目地址: https://gitcode.com/GitHub_Trending/re/ravanced-patches ReVanced Patches是一个专注于为Android应用提供功…

作者头像 李华
网站建设 2026/6/10 20:53:20

题解:学而思编程 优秀的排列

本文分享的必刷题目是从蓝桥云课、洛谷、AcWing等知名刷题平台精心挑选而来,并结合各平台提供的算法标签和难度等级进行了系统分类。题目涵盖了从基础到进阶的多种算法和数据结构,旨在为不同阶段的编程学习者提供一条清晰、平稳的学习提升路径。 欢迎大家订阅我的专栏:算法…

作者头像 李华
网站建设 2026/6/10 20:53:14

在线免费图片处理工具-传道软件图片工具

在线免费图片处理工具-传道软件图片工具 在线免费图片处理工具,无需注册与登录,用完即走。 官网链接: https://www.chdaoai.com/ 功能有: Favicon图标生成,图片颜色拾取器,屏幕颜色拾取,图片…

作者头像 李华
网站建设 2026/6/10 20:51:41

DexKit开发者指南:深入理解C++实现的dex解析引擎

DexKit开发者指南:深入理解C实现的dex解析引擎 【免费下载链接】DexKit An easy-to-use, high-performance dex deobfuscation library. 项目地址: https://gitcode.com/gh_mirrors/de/DexKit DexKit是一款简单易用、高性能的dex反混淆库,其核心功…

作者头像 李华
网站建设 2026/6/10 20:43:11

Nex-N2-mini 开发者指南:如何优化采样参数与推理性能调优

Nex-N2-mini 开发者指南:如何优化采样参数与推理性能调优 【免费下载链接】Nex-N2-mini 项目地址: https://ai.gitcode.com/hf_mirrors/nex-agi/Nex-N2-mini Nex-N2-mini 是一款基于 Qwen3.5-35B 架构的开源智能体模型,专为实际生产场景设计&…

作者头像 李华