lonePatient / BERT-NER-Pytorch

Chinese NER(Named Entity Recognition) using BERT(Softmax, CRF, Span)
MIT License
2.09k stars 428 forks source link

Problem:num_samples should be a positive integer value, but got num_samples=0 #93

Open git-saner opened 1 year ago

git-saner commented 1 year ago

File "D:/Pycharmprojects/BERT-NER-Pytorch/run_ner_crf.py", line 496, in main() File "D:/Pycharmprojects/BERT-NER-Pytorch/run_ner_crf.py", line 437, in main global_step, tr_loss = train(args, train_dataset, model, tokenizer) File "D:/Pycharmprojects/BERT-NER-Pytorch/run_ner_crf.py", line 34, in train train_sampler = RandomSampler(train_dataset) if args.local_rank == -1 else DistributedSampler(train_dataset) File "D:\anaconda3\envs\pytorch\lib\site-packages\torch\utils\data\sampler.py", line 107, in init raise ValueError("num_samples should be a positive integer " ValueError: num_samples should be a positive integer value, but got num_samples=0

Process finished with exit code 1

decorum1998 commented 1 year ago

Hava u solved this problem? Im in the same situation.

luoshengmen98 commented 1 year ago

yep! I also met this problem if I used my dataset ! Please how to sovle the trouble!