YOLOv5-LibTorch icon indicating copy to clipboard operation
YOLOv5-LibTorch copied to clipboard

Error in inference on other size except (640,640)

Open Yasin40 opened this issue 4 years ago • 3 comments

Hi, I want inference my .torchscript.pt which is trained by this command and switch:

python train.py --img 128 128 --rect ...

but, by change resize function in this repo to (128,128), i got error:

RuntimeError: The size of tensor a (32) must match the size of tensor b (80) at non-singleton dimension 3

but, i don't know where should i change to work for me. please help me.

Yasin40 avatar Dec 15 '20 07:12 Yasin40

Bro, your error is obviously because there is a problem with the number of categories, and it has nothing to do with the image size. I used COCO to train 80 categories. Did you train a 32-category? Please do not come to me if there are any minor problems in the code, can it be solved by yourself?

Nebula4869 avatar Dec 15 '20 08:12 Nebula4869

No, if this problem was relate to category, doesn't work by change to 640,640. Am i right?

Yasin40 avatar Dec 15 '20 09:12 Yasin40

Yes u r right, i have nothing to say

------------------ 原始邮件 ------------------ 发件人: "notifications"<[email protected]>; 发送时间: 2020年12月15日(星期二) 下午5:39 收件人: "Nebula4869/YOLOv5-LibTorch"<[email protected]>; 抄送: "Nebula"<[email protected]>; "Comment"<[email protected]>; 主题: Re: [Nebula4869/YOLOv5-LibTorch] Error in inference on other size except (640,640) (#7)

No, if this problem was relate to category, doesn't work by change to 640,640. Am i right?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

Nebula4869 avatar Dec 15 '20 09:12 Nebula4869