pytorch-openpose icon indicating copy to clipboard operation
pytorch-openpose copied to clipboard

runtime error for demo.jpg -- RuntimeError: Given groups=1, weight of size [256, 512, 3, 3], expected input[1, 3, 46, 32] to have 512 channels, but got 3 channels instead

Open ehartz01 opened this issue 6 years ago • 3 comments

Any idea what's happening?

SED-ML-0148% python demo1.py Traceback (most recent call last): File "demo1.py", line 17, in candidate, subset = body_estimation(oriImg) File "python/body.py", line 46, in call Mconv7_stage6_L1, Mconv7_stage6_L2 = self.model(data) File "/Users/ehartz01/Desktop/SignPhonologizer/nicey/lib/python2.7/site-packages/torch/nn/modules/module.py", line 489, in call result = self.forward(*input, **kwargs) File "python/model.py", line 108, in forward out1 = self.model0(x) File "/Users/ehartz01/Desktop/SignPhonologizer/nicey/lib/python2.7/site-packages/torch/nn/modules/module.py", line 489, in call result = self.forward(*input, **kwargs) File "/Users/ehartz01/Desktop/SignPhonologizer/nicey/lib/python2.7/site-packages/torch/nn/modules/container.py", line 92, in forward input = module(input) File "/Users/ehartz01/Desktop/SignPhonologizer/nicey/lib/python2.7/site-packages/torch/nn/modules/module.py", line 489, in call result = self.forward(*input, **kwargs) File "/Users/ehartz01/Desktop/SignPhonologizer/nicey/lib/python2.7/site-packages/torch/nn/modules/conv.py", line 320, in forward self.padding, self.dilation, self.groups) RuntimeError: Given groups=1, weight of size [256, 512, 3, 3], expected input[1, 3, 46, 32] to have 512 channels, but got 3 channels instead

ehartz01 avatar Jan 22 '19 16:01 ehartz01

I got the same error. The code uses all the OrderedDict in the wrong way, you can just turn the parameter from dict to list to remove the bug. snipaste_2019-03-04_16-30-09

JiageWang avatar Mar 04 '19 08:03 JiageWang

Did you change every block to a list?

ehartz01 avatar Apr 19 '19 16:04 ehartz01

It would be nice to have this updated in the code

souljaboy764 avatar Nov 22 '19 15:11 souljaboy764