libtorch-yolov5 icon indicating copy to clipboard operation
libtorch-yolov5 copied to clipboard

run yolov5 v4.0 error

Open caixiong110 opened this issue 4 years ago • 6 comments

run: ./libtorch-yolov5 --source ../images/bus.jpg --weights ../weights/yolov5s.torchscript.pt --gpu --view-img error: terminate called after throwing an instance of 'torch::jit::ErrorReport' what():

aten::_convolution(Tensor input, Tensor weight, Tensor? bias, int[] stride, int[] padding, int[] dilation, bool transposed, int[] output_padding, int groups, bool benchmark, bool deterministic, bool cudnn_enabled) -> (Tensor): Expected at most 12 arguments but found 13 positional arguments.

why found 13 positional arguments?

system is NVIDIA Jetson Xavier NX and docker opencv 4.4.0 libtorch 1.6.0 cuda 10.2 yolov5 v4.0

caixiong110 avatar Feb 18 '21 08:02 caixiong110

Hi @caixiong110, could you try yolov5 v3.0 or v3.1. Seems they modified the arch since v4.0 but I don't have time to catch it up at this moment.

yasenh avatar Feb 18 '21 15:02 yasenh

@caixiong110 I am facing the same error as you. Do you have any solution?

Jelly123456 avatar Feb 26 '21 04:02 Jelly123456

I am using v3.0 and v3.1, and facing this error too.

Apostatee avatar Mar 03 '21 03:03 Apostatee

@Apostatee The root cause for this error is that pytorch version and libtorch are not the same. you can check your pytorch version and it has nothing to do with whether it is YoLov5-V3.0 or YoLov5-V3.1.

Hope this information can help you.

Jelly123456 avatar Mar 08 '21 10:03 Jelly123456

aten::_convolution(Tensor input, Tensor weight, Tensor? bias, int[] stride, int[] padding, int[] dilation, bool transposed, int[] output_padding, int groups, bool benchmark, bool deterministic, bool cudnn_enabled) -> (Tensor): Expected at most 12 arguments but found 13 positional arguments.

hello,Do you have sovle this problem?

zhujinwen0924 avatar Jan 22 '22 12:01 zhujinwen0924

i solved it, you must ensure version consistency that python install libtorch with you C++ used libtorch version,such as libtorch 1.7 with same python used install version 'libtorch 1.7' (or 1.6 sames).

At 2022-01-22 20:53:48, "zhujinwen0924" @.***> wrote:

aten::_convolution(Tensor input, Tensor weight, Tensor? bias, int[] stride, int[] padding, int[] dilation, bool transposed, int[] output_padding, int groups, bool benchmark, bool deterministic, bool cudnn_enabled) -> (Tensor): Expected at most 12 arguments but found 13 positional arguments.

hello,Do you have sovle this problem?

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you were mentioned.Message ID: @.***>

caixiong110 avatar Feb 21 '22 09:02 caixiong110