longcw / faster_rcnn_pytorch

Faster RCNN with PyTorch
MIT License
1.7k stars 466 forks source link

Problem: Index tensor must have same dimensions as output tensor #30

Open nku428 opened 7 years ago

nku428 commented 7 years ago

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 gradinput.scatter(dim, indices, gradoutput) 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!

mbchang commented 6 years ago

I'm having the same problem too.

daniilhayrapetyan commented 6 years ago

Got the same issue

YykThu commented 6 years ago

got the same problem, any solutions now? thx

YykThu commented 6 years ago

ok, I upgrade pytorch to 0.3.1 and problem solved