nlp-tutorial icon indicating copy to clipboard operation
nlp-tutorial copied to clipboard

num_samples should be a positive integer value, but got num_samples=0

Open staticgsm opened this issue 6 years ago • 1 comments

python train.py --epochs 12 --batch_size 2 --learning_rate .001 --hidden_size 64 --n_layers 1 --dropout_p .1

number of trained word vectors of data/glove.6B.100d.txt: 400000 Traceback (most recent call last): File "train.py", line 200, in train_loader = DataLoader(dataset=qa_train, batch_size=config.batch_size, shuffle=True, num_workers=4) File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py", line 176, in init sampler = RandomSampler(dataset) File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/sampler.py", line 66, in init "value, but got num_samples={}".format(self.num_samples)) ValueError: num_samples should be a positive integer value, but got num_samples=0

Please Let Know What's the exact issue

staticgsm avatar May 19 '19 16:05 staticgsm

HI, @staticgsm

Could you check if the code below works well? There seems to be no data qa_train variable.

qa_train = QuestionAnswerDataset(train, tokenizer, negative_sampling=True)

lyeoni avatar May 23 '19 03:05 lyeoni