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

getting the index out of bound error in han.yaml python train.py --config ./configs/han.yaml #1

Closed
VinACE opened this issue Dec 4, 2020 · 1 comment

Comments

@VinACE
Copy link

VinACE commented Dec 4, 2020

result = self.forward(*input, **kwargs)

File "/home/ahsadmin/anaconda3/envs/san/lib/python3.8/site-packages/torch/nn/modules/sparse.py", line 124, in forward
return F.embedding(
File "/home/ahsadmin/anaconda3/envs/san/lib/python3.8/site-packages/torch/nn/functional.py", line 1852, in embedding
return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
IndexError: index out of range in self

How to solve this error..?

Also I am getting the following in the batch,

(Pdb) batch
[tensor([[ 1, 2, 3, ..., 0, 0, 0],
[ 1, 23959, 3, ..., 0, 0, 0],
[ 1, 23959, 3, ..., 0, 0, 0],
...,
[ 1, 23959, 3, ..., 3, 6, 3],
[ 1, 23959, 3, ..., 6, 3, 0],
[ 1, 2, 3, ..., 3, 6, 3]]), tensor([[188],
[184],
[190],
[197],
[197],
[200],
[200],
[193],
[200],
[200],
[194],
[184],
[191],
[200],
[200],
[195],
[181],
[180],
[198],
[196],
[190],
[188],
[197],
[196],
[195],
[183],
[185],
[192],
[197],
[200],
[199],
[200]]), tensor([[-1],
[ 0],
[ 0],
[ 0],
[ 0],
[-1],
[-1],
[ 0],
[ 0],
[-1],
[ 0],
[ 0],
[ 0],
[-1],
[ 0],
[ 0],
[ 0],
[ 0],
[ 0],
[ 0],
[-1],
[ 0],
[ 0],
[ 0],
[ 0],
[ 0],
[ 0],
[-1],
[-1],
[ 0],
[ 0],
[ 0]])]
(Pdb) n

not sure about the -1 in the labels...

@VinACE
Copy link
Author

VinACE commented Dec 8, 2020

Had class labels encoded from 0, actually in this code is expecting class labels from "1"

@VinACE VinACE closed this as completed Dec 8, 2020
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