ReID-MGN icon indicating copy to clipboard operation
ReID-MGN copied to clipboard

help me to resolve this error

Open ssbilakeri opened this issue 3 years ago • 1 comments

triplwtloss is giving dimension error. Please help me to fix this error.

File "main.py", line 50, in train loss = self.loss(outputs, labels) File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(*input, **kwargs) File "/content/STREID/loss.py", line 14, in forward Triplet_Loss = [triplet_loss(output, labels) for output in outputs[1:4]] File "/content/STREID/loss.py", line 14, in Triplet_Loss = [triplet_loss(output, labels) for output in outputs[1:4]] File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(*input, **kwargs) File "/content/STREID/loss.py", line 57, in forward dist = torch.pow(inputs, 2).sum(dim=1, keepdim=True).expand(n, n) IndexError: Dimension out of range (expected to be in range of [-1, 0], but got 1)

ssbilakeri avatar May 04 '21 17:05 ssbilakeri

what you change? Please make it clearer.

GNAYUOHZ avatar May 08 '21 07:05 GNAYUOHZ