lmnt-com / diffwave

DiffWave is a fast, high-quality neural vocoder and waveform synthesizer.
Apache License 2.0
767 stars 112 forks source link

Trying to run training after preprocess #9

Closed mattjwarren closed 3 years ago

mattjwarren commented 3 years ago

following the steps in the readme, after trying

python3.7 -m diffwave ~/tf_runs/diffwave_test/ ~/datasets/R2

we get the error;

Traceback (most recent call last): File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/usr/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/matt/.local/lib/python3.7/site-packages/diffwave/main.py", line 53, in main(parser.parse_args()) File "/home/matt/.local/lib/python3.7/site-packages/diffwave/main.py", line 39, in main train(args, params) File "/home/matt/.local/lib/python3.7/site-packages/diffwave/learner.py", line 169, in train dataset = dataset_from_path(args.data_dirs, params) File "/home/matt/.local/lib/python3.7/site-packages/diffwave/dataset.py", line 87, in from_path drop_last=True) File "/home/matt/.local/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 262, in init sampler = RandomSampler(dataset, generator=generator) # type: ignore File "/home/matt/.local/lib/python3.7/site-packages/torch/utils/data/sampler.py", line 104, 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

training set - the files in ~/datasets/R2 are a list of approx 49000 16 bit mono 44100 khz samples that have all had the pre-processing step run for them successfully and generated npy files. Sample rate has been updated as appropriate in params.py.

Any help with the problem would be appreciated

sharvil commented 3 years ago

It looks like the dataset is empty. That may happen if, for example, you delete the .wav files after preprocessing the data. Can you check your ~/datasets/R2 directory to see if you have still have the .wav files side-by-side with the corresponding .npy files?

Another good way to check is to print out the list of .wav files found in src/diffwave/dataset.py (in the constructor of NumpyDataset). Just print out self.filenames to see what it found in the dataset directory.

mattjwarren commented 3 years ago

This was exactly the problem; and the model is successfully training now. thankyou.