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: invalid argument 0: Sizes of tensors must match except in dimension 1. Got 272 and 270 in dimension 2 at /pytorch/aten/src/THC/generic/THCTensorMath.cu:71 #1

Open
wudrans opened this issue Sep 8, 2020 · 0 comments

Comments

@wudrans
Copy link

wudrans commented Sep 8, 2020

Traceback (most recent call last):
File "/home/wlj/softPakage/pycharm-community-2019.2/helpers/pydev/pydevd.py", line 2060, in
main()
File "/home/wlj/softPakage/pycharm-community-2019.2/helpers/pydev/pydevd.py", line 2054, in main
globals = debugger.run(setup['file'], None, None, is_module)
File "/home/wlj/softPakage/pycharm-community-2019.2/helpers/pydev/pydevd.py", line 1405, in run
return self._exec(is_module, entry_point_fn, module_name, file, globals, locals)
File "/home/wlj/softPakage/pycharm-community-2019.2/helpers/pydev/pydevd.py", line 1412, in _exec
pydev_imports.execfile(file, globals, locals) # execute the script
File "/home/wlj/softPakage/pycharm-community-2019.2/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/home/wlj/work/download_master/csp_pytorch-master/test_one_pic_pedestrian.py", line 25, in
x_cls, x_reg, x_off = model(x)
File "/home/wlj/.virtualenvs/pytorch_virtualenv/lib/python3.6/site-packages/torch/nn/modules/module.py", line 547, in call
result = self.forward(*input, **kwargs)
File "/home/wlj/work/download_master/csp_pytorch-master/models/cspnet.py", line 177, in forward
cat = torch.cat([p3up, p4up, p5up], dim=1)
RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 1. Got 272 and 270 in dimension 2 at /pytorch/aten/src/THC/generic/THCTensorMath.cu:71

我直接运行test_caltech.py,会报错如上,torch.cat时,数据维度不一样,请问这该怎么解决呢

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