Alexander-H-Liu / End-to-end-ASR-Pytorch

This is an open source project (formerly named Listen, Attend and Spell - PyTorch Implementation) for end-to-end ASR implemented with Pytorch, the well known deep learning toolkit.
MIT License
1.18k stars 318 forks source link

error running example code line #39

Closed MNCTTY closed 5 years ago

MNCTTY commented 5 years ago

Hello! I tried to run test example and get this error

~/End-to-end-ASR-Pytorch$ python3.7 main.py --config config/libri_example.yaml
main.py:28: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
  config = yaml.load(open(paras.config,'r'))
[INFO] Loading data from data/libri_fbank80_subword5000
<src.dataset.LibriDataset object at 0x7f7d895c9080>
Traceback (most recent call last):
  File "main.py", line 47, in <module>
    solver.load_data()
  File "/home/karina/End-to-end-ASR-Pytorch/src/solver.py", line 75, in load_data
    setattr(self,'train_set',LoadDataset('train',text_only=False,use_gpu=self.paras.gpu,**self.config['solver']))
  File "/home/karina/End-to-end-ASR-Pytorch/src/dataset.py", line 155, in LoadDataset
    return  DataLoader(ds, batch_size=1,shuffle=shuffle,drop_last=False,num_workers=n_jobs,pin_memory=use_gpu)
  File "/usr/local/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 176, in __init__
    sampler = RandomSampler(dataset)
  File "/usr/local/lib/python3.7/site-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

do you know how to solve it? or what's the problem itself?