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

TypeError: conv2d() received an invalid combination of arguments - got (Tensor, Parameter, NoneType, tuple, tuple, tuple, int), but expected one of: #2

Open
ming200825 opened this issue Aug 17, 2023 · 5 comments

Comments

@ming200825
Copy link

`(yolov8) PS E:\P\Python\yolov8-plate> python detect_rec_plate.py --detect_model weights/yolov8-lite-t-plate.pt --rec_model weights/plate_rec_color.pth --image_path imgs --output result
yolov8 detect params: 0.59M,rec params: 0.18M
0 imgs\double_yellow.jpg Traceback (most recent call last):
File "detect_rec_plate.py", line 234, in
result_list=det_rec_plate(img,img_ori,detect_model,plate_rec_model)
File "detect_rec_plate.py", line 132, in det_rec_plate
predict = detect_model(img)[0]
File "D:\ProgramData\anaconda3\envs\yolov8\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
File "E:\P\Python\yolov8-plate\ultralytics\nn\tasks.py", line 45, in forward
return self.predict(x, *args, **kwargs)
File "E:\P\Python\yolov8-plate\ultralytics\nn\tasks.py", line 62, in predict
return self._predict_once(x, profile, visualize)
File "E:\P\Python\yolov8-plate\ultralytics\nn\tasks.py", line 82, in _predict_once
x = m(x) # run
File "D:\ProgramData\anaconda3\envs\yolov8\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
File "E:\P\Python\yolov8-plate\ultralytics\nn\modules\block.py", line 52, in forward
stem_1_out = self.stem_1(x)
File "D:\ProgramData\anaconda3\envs\yolov8\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
File "E:\P\Python\yolov8-plate\ultralytics\nn\modules\conv.py", line 38, in forward
return self.act(self.bn(self.conv(x)))
File "D:\ProgramData\anaconda3\envs\yolov8\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
File "D:\ProgramData\anaconda3\envs\yolov8\lib\site-packages\torch\nn\modules\conv.py", line 463, in forward
return self._conv_forward(input, self.weight, self.bias)
File "D:\ProgramData\anaconda3\envs\yolov8\lib\site-packages\torch\nn\modules\conv.py", line 459, in _conv_forward
return F.conv2d(input, weight, bias, self.stride,
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)
    `
@WANGCHAO1996
Copy link

你好 怎么解决的这个问题 看起来像是图片输入问题

@qinzhenyi1314
Copy link

已经解决了吗?同样遇到了这个错误~

@we0091234
Copy link
Owner

已经解决了吗?同样遇到了这个错误~

torch 换1.8的版本

@qinzhenyi1314
Copy link

已经解决了吗?同样遇到了这个错误~

torch 换1.8的版本

我这边换成1.8的版本,解决了

@futureflsl
Copy link

没有深入研究这个报错吗,为什么1.8可以,1.9的pytorch就不行了。我看了下图片输入都是yolov5/yolov7/yolov8输入差不多,因此不是图片输入问题,而是模型问题,我尝试修改加载模型发现问题一样,可能模型采用1.8pytorch训练出来的,里面存储模型参数有些事pytorch1.9不支持

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

5 participants