Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GhostnetV2问题 #174

Open
fenton-lu opened this issue Jan 11, 2023 · 3 comments
Open

GhostnetV2问题 #174

fenton-lu opened this issue Jan 11, 2023 · 3 comments

Comments

@fenton-lu
Copy link

您好,请问ghostV2直接替换YOLOv5中的ghostV1会报错,是需要修改ghostV2的代码吗?

Traceback (most recent call last):
  File "train.py", line 667, in <module>
    main(opt)
  File "train.py", line 562, in main
    train(opt.hyp, opt, device, callbacks)
  File "train.py", line 121, in train
    model = Model(cfg or ckpt['model'].yaml, ch=3, nc=nc, anchors=hyp.get('anchors')).to(device)  # create
  File "/home/tmp/lhr/yolov5/models/yolo.py", line 121, in __init__
    m.stride = torch.tensor([s / x.shape[-2] for x in self.forward(torch.zeros(1, ch, s, s))])  # forward
  File "/home/tmp/lhr/yolov5/models/yolo.py", line 135, in forward
    return self._forward_once(x, profile, visualize)  # single-scale inference, train
  File "/home/tmp/lhr/yolov5/models/yolo.py", line 158, in _forward_once
    x = m(x)  # run
  File "/home/tmp/anaconda3/envs/yolov5-lhr/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/tmp/lhr/yolov5/models/common.py", line 144, in forward
    return self.cv3(torch.cat((self.m(self.cv1(x)), self.cv2(x)), 1))
  File "/home/tmp/anaconda3/envs/yolov5-lhr/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/tmp/lhr/yolov5/models/common.py", line 52, in forward
    return self.act(self.bn(self.conv(x)))
  File "/home/tmp/anaconda3/envs/yolov5-lhr/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/tmp/anaconda3/envs/yolov5-lhr/lib/python3.8/site-packages/torch/nn/modules/conv.py", line 447, in forward
    return self._conv_forward(input, self.weight, self.bias)
  File "/home/tmp/anaconda3/envs/yolov5-lhr/lib/python3.8/site-packages/torch/nn/modules/conv.py", line 443, in _conv_forward
    return F.conv2d(input, weight, bias, self.stride,
TypeError: conv2d() received an invalid combination of arguments - got (NoneType, 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: (NoneType, 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: (NoneType, Parameter, NoneType, tuple, tuple, tuple, int)
@Shin-God
Copy link

Shin-God commented Jul 9, 2023

我也是这错误。。。请问下如何解决呢。。。

@nortorious
Copy link

我也想知道如何加入到yolov5中,ghostbottleneckv2他要输入三个通道数,而ghostbottleneck只需要两个,不晓得咋整?

@Administor123
Copy link

同问,我想把GhostnetV2加入C3模块,请问大家有方法吗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants