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

IndexError: Dimension out of range (expected to be in range of [-1, 0], but got 1) #3

Open
TTTJJJWWW opened this issue Nov 6, 2019 · 0 comments

Comments

@TTTJJJWWW
Copy link

Hi! @Joyako
when i use a-softmax in my codes, i get errors as follow:
File "train.py", line 276, in <module> train() File "train.py", line 174, in train loss = criterion(scores, labels) File "/home/iie/.conda/envs/lib/python3.7/site-packages/torch/nn/modules/module.py", line 547, in __call__ result = self.forward(*input, **kwargs) File "/home/iie/loss.py", line 25, in forward index.scatter_(1, target.data.view(-1, 1), 1) IndexError: Dimension out of range (expected to be in range of [-1, 0], but got 1)
how can i fix this?

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

1 participant