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!
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!