YeNet-Pytorch icon indicating copy to clipboard operation
YeNet-Pytorch copied to clipboard

RuntimeError

Open xytywh opened this issue 6 years ago • 5 comments

when I run the program,I meet blow error:

RuntimeError :Expected 4-dimensional input for 4-dimensional weight [30,1,5,5],but got 5- dimensional input of size [16,2,1,256,256] instead

I don't know why?please help me!

xytywh avatar May 06 '19 07:05 xytywh

Have you solved the problem?I have the same problem as you

HarryAB avatar Oct 10 '19 01:10 HarryAB

Have you solved the problem?I have the same problem as you

hello, have you solved this problem?

wanyan-li avatar Apr 21 '20 04:04 wanyan-li

have anyone solved this problem?................

niefengxxx avatar May 19 '20 04:05 niefengxxx

Same problem! Have anyone solved it?

Yogurt2019 avatar Jun 20 '20 13:06 Yogurt2019

I solved it just add three lines under train()->images, labels = images.cuda(), labels.cuda():

`shape = list(images.shape)

images = images.view(shape[0]*shape[1], *shape[2:])

labels = labels.view(-1)`

just combine the 1st and the 2nd dimension of images and labels.

Yogurt2019 avatar Jun 21 '20 02:06 Yogurt2019