lyeoni / nlp-tutorial

A list of NLP(Natural Language Processing) tutorials
MIT License
1.37k stars 264 forks source link

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

Open staticgsm opened 5 years ago

staticgsm commented 5 years ago

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

lyeoni commented 5 years ago

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)