drethage / speech-denoising-wavenet

A neural network for end-to-end speech denoising
MIT License
673 stars 165 forks source link

ValueError: output of generator should be a tuple (x, y, sample_weight) or (x, y). Found: None #12

Closed DillipKS closed 6 years ago

DillipKS commented 6 years ago

Getting two errors while training the Wavenet model on Google Colab cloud GPU.

  1. File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner self.run() File "/usr/lib/python2.7/threading.py", line 754, in run self.target(*self.args, **self.__kwargs) File "/usr/local/lib/python2.7/dist-packages/keras/engine/training.py", line 409, in data_generator_task generator_output = next(generator) File "/content/drive/app/speech-denoising-wavenet/datasets.py", line 125, in get_random_batch_generator noise = noisy - speech ValueError: operands could not be broadcast together with shapes (65302,) (60727,)

  2. File "main.py", line 169, in main() File "main.py", line 163, in main training(config, cla) File "main.py", line 81, in training config['training']['num_epochs']) File "/content/drive/app/speech-denoising-wavenet/models.py", line 167, in fit_model initial_epoch=self.epoch_num) File "/usr/local/lib/python2.7/dist-packages/keras/engine/training.py", line 1481, in fit_generator str(generator_output)) "ValueError: output of generator should be a tuple (x, y, sample_weight) or (x, y). Found: None".

Any idea what the issue is and how to resolve it? @drethage

kfmn commented 6 years ago

I have the same errors!

kfmn commented 6 years ago

I have solved this issue. The problem is that clean and noisy files may be sorted slightly differently by os.listdir (at dataset.py, line 53) and then clean and noisy speech waveforms turn to be of different length at datasets.py, line 125. The solution is just to replace os.listdir(directory_path) with sorted(os.listdir(directory_path)) at dataset.py, line 53

DillipKS commented 6 years ago

Thanks a ton @kfmn for finding the bug. Now it works fine for me too.