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: index 1014 is out of bounds for dimension 0 with size 1014 #7

Open
feiyangdezhu opened this issue Nov 16, 2018 · 5 comments

Comments

@feiyangdezhu
Copy link

I changed a data set, and the rest is consistent with your code, but the result above appears. I don't know the reason, please kindly answer for me in your busy schedule, thank you

@srviest
Copy link
Owner

srviest commented Nov 19, 2018

can you provide more information about the dataset you are using?

@feiyangdezhu
Copy link
Author

I use the data set is more than 1014 characters in a row, but when change the lo to 4056, and an error is as follows: a RuntimeError: size mismatch, m1:32 x [37376], the m2: [8704 x 8704] at/pytorch aten/SRC/TH/generic/THTensorMath CPP: 2070

@feiyangdezhu
Copy link
Author

I want to know what parameter values the CNN model needs to adjust when changing lo value, namely max length of a sample

@zhijing-jin
Copy link

zhijing-jin commented Feb 16, 2019

Hi, it seems that the argument "--l0" in train.py sets the max length of samples. Feel free to adjust it to a larger value

You should also change line 222, 231 in train.py from
train_dataset = AGNEWs(label_data_path=args.train_path, alphabet_path=args.alphabet_path)
to
train_dataset = AGNEWs(label_data_path=args.train_path, alphabet_path=args.alphabet_path, l0=args.l0),

and from
dev_dataset = AGNEWs(label_data_path=args.val_path, alphabet_path=args.alphabet_path)
to
dev_dataset = AGNEWs(label_data_path=args.val_path, alphabet_path=args.alphabet_path, l0=args.l0)

srviest added a commit that referenced this issue Mar 23, 2019
@srviest
Copy link
Owner

srviest commented Mar 23, 2019

@zhijing-jin thx!
@feiyangdezhu issue fixed, try again.

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

3 participants