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

help me to resolve this error #31

Open
ssbilakeri opened this issue May 4, 2021 · 1 comment
Open

help me to resolve this error #31

ssbilakeri opened this issue May 4, 2021 · 1 comment

Comments

@ssbilakeri
Copy link

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)

@GNAYUOHZ
Copy link
Owner

GNAYUOHZ commented May 8, 2021

what you change? Please make it clearer.

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

2 participants