yolov8-plate icon indicating copy to clipboard operation
yolov8-plate copied to clipboard

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

Open ming200825 opened this issue 2 years ago • 5 comments

`(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) `

ming200825 avatar Aug 17 '23 02:08 ming200825

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

WANGCHAO1996 avatar Oct 14 '23 14:10 WANGCHAO1996

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

qinzhenyi1314 avatar Oct 19 '23 09:10 qinzhenyi1314

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

torch 换1.8的版本

we0091234 avatar Oct 19 '23 12:10 we0091234

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

torch 换1.8的版本

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

qinzhenyi1314 avatar Oct 25 '23 02:10 qinzhenyi1314

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

futureflsl avatar Jan 23 '24 06:01 futureflsl