yolor icon indicating copy to clipboard operation
yolor copied to clipboard

RuntimeError: Sizes of tensors must match except in dimension 2. Got 28 and 27 (The offending index is 0)

Open GMN23362 opened this issue 2 years ago • 4 comments

Any help will be so appreciated!

GMN23362 avatar May 09 '22 13:05 GMN23362

I seem to run into this exact same problem when trying to inference using a webcam

blitzkz23 avatar May 11 '22 21:05 blitzkz23

I got similar issue while running inference on cams. you could just try different image size(usually one of these three works:1280,640,320). I guess it must be something with tensor splitting or resizing.

XWHtorrentx avatar Jun 01 '22 13:06 XWHtorrentx

I got similar issue while running inference on cams. you could just try different image size(usually one of these three works:1280,640,320). I guess it must be something with tensor splitting or resizing.

Ah yes, I second this. I've figured out the reason back then but I forgot to rep back on this issue. For me, It's because my webcam resolution is 640x360 so I need to pass the --img-size 640 to the parameter in order for it to work.

blitzkz23 avatar Jun 01 '22 13:06 blitzkz23

change datasets.py function letterbox(auto = True) into letterbox(auto = False),can inference all pictures in 1280 scale

yang-0201 avatar Aug 13 '22 07:08 yang-0201