Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeError: Need input.size[1] == 3 but got 4 instead. #5

Open
lclin1010 opened this issue Jan 24, 2019 · 0 comments
Open

RuntimeError: Need input.size[1] == 3 but got 4 instead. #5

lclin1010 opened this issue Jan 24, 2019 · 0 comments

Comments

@lclin1010
Copy link

When I run :

python demo.py --model_name DenseASPP161 --model_path ./weights/denseASPP161.pkl --img_dir ./img

I got this:

loading pre-trained weight
1.png
Traceback (most recent call last):
File "demo.py", line 19, in
infer.folder_inference(args.img_dir, is_multiscale=False)
File "/home/dl/code/DenseASPP/inference.py", line 71, in folder_inference
pre = self.single_inference(img)
File "/home/dl/code/DenseASPP/inference.py", line 94, in single_inference
pre = self.seg_model.forward(image)
File "/home/dl/code/DenseASPP/models/DenseASPP.py", line 114, in forward
feature = self.features(_input)
File "/home/dl/anaconda2/lib/python2.7/site-packages/torch/nn/modules/module.py", line 224, in call
result = self.forward(*input, **kwargs)
File "/home/dl/anaconda2/lib/python2.7/site-packages/torch/nn/modules/container.py", line 67, in forward
input = module(input)
File "/home/dl/anaconda2/lib/python2.7/site-packages/torch/nn/modules/module.py", line 224, in call
result = self.forward(*input, **kwargs)
File "/home/dl/anaconda2/lib/python2.7/site-packages/torch/nn/modules/conv.py", line 254, in forward
self.padding, self.dilation, self.groups)
File "/home/dl/anaconda2/lib/python2.7/site-packages/torch/nn/functional.py", line 52, in conv2d
return f(input, weight, bias)
RuntimeError: Need input.size[1] == 3 but got 4 instead.

Do you know what is the problem? Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant