faster_rcnn_pytorch icon indicating copy to clipboard operation
faster_rcnn_pytorch copied to clipboard

Problem: Index tensor must have same dimensions as output tensor

Open nku428 opened this issue 7 years ago • 4 comments

Traceback (most recent call last): File "train.py", line 154, in loss.backward() File "/usr/local/lib/python3.5/dist-packages/torch/autograd/variable.py", line 152, in backward torch.autograd.backward(self, gradient, retain_graph, create_graph, retain_variables) File "/usr/local/lib/python3.5/dist-packages/torch/autograd/init.py", line 98, in backward variables, grad_variables, retain_graph) File "/usr/local/lib/python3.5/dist-packages/torch/autograd/function.py", line 90, in apply return self.forward_cls.backward(self, *args) File "/usr/local/lib/python3.5/dist-packages/torch/autograd/functions/reduce.py", line 176, in backward grad_input.scatter(dim, indices, grad_output) File "/usr/local/lib/python3.5/dist-packages/torch/autograd/variable.py", line 655, in scatter return Scatter.apply(self, dim, index, source, True) File "/usr/local/lib/python3.5/dist-packages/torch/autograd/functions/tensor.py", line 540, in forward return input.scatter(ctx.dim, index, source) RuntimeError: Index tensor must have same dimensions as output tensor at /home/pytorch/torch/lib/TH/generic/THTensorMath.c:454

I'm not sure how/why this error occurs, what should i do to make it work. Thanks!

nku428 avatar Jun 20 '17 06:06 nku428

I'm having the same problem too.

mbchang avatar Sep 21 '17 05:09 mbchang

Got the same issue

daniilhayrapetyan avatar Dec 20 '17 08:12 daniilhayrapetyan

got the same problem, any solutions now? thx

YykThu avatar Apr 19 '18 10:04 YykThu

ok, I upgrade pytorch to 0.3.1 and problem solved

YykThu avatar Apr 19 '18 10:04 YykThu