char-cnn-text-classification-pytorch
char-cnn-text-classification-pytorch copied to clipboard
IndexError: index 1014 is out of bounds for dimension 0 with size 1014
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
can you provide more information about the dataset you are using?
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
I want to know what parameter values the CNN model needs to adjust when changing lo value, namely max length of a sample
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)
@zhijing-jin thx! @feiyangdezhu issue fixed, try again.