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

run problem #35

Closed
ICDI0906 opened this issue Apr 29, 2019 · 4 comments
Closed

run problem #35

ICDI0906 opened this issue Apr 29, 2019 · 4 comments

Comments

@ICDI0906
Copy link

when I run this code, there occurred some problems
(1) in LabelSmoothing class
this line => true_dist.index_fill_(0, mask.squeeze(), 0.0)
RuntimeError: invalid argument 3: Index is supposed to be a vector at /Users/soumith/code/builder/wheel/pytorch-src/aten/src/TH/generic/THTensorMath.cpp:569
(2) in SimpleLossCompute class
this lien = > loss = self.criterion(x.contiguous().view(-1, x.size(-1)), y.contiguous().view(-1)) / norm
RuntimeError: Expected object of type torch.FloatTensor but found type torch.LongTensor for argument #2 'other'
my torch version is 0.4.1
does anyone have these problem? thanks~

@cuihx13
Copy link

cuihx13 commented Jun 26, 2019

Hello! I met the same problem in LabelSmoothing class as you proposed. Did you solve this problem? Looking forward to your reply. Thanks!

@ICDI0906
Copy link
Author

I can't remember that, but this link pytorch/pytorch#3416 maybe help.

@cuihx13
Copy link

cuihx13 commented Jun 26, 2019

Thank you very much

@nan1104
Copy link

nan1104 commented Oct 8, 2019

hello, I have the same problem in SimpleLossCompute class as you proposed, and can't figure it out. Did you solve this problem? Looking forward to your reply. Thanks!

@srush srush closed this as completed May 2, 2022
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

4 participants