basveeling / wavenet

Keras WaveNet implementation
https://soundcloud.com/basveeling/wavenet-sample
1.06k stars 219 forks source link

Generation step produces noise #4

Closed robinsloan closed 7 years ago

robinsloan commented 7 years ago

This is great. It's very cool to have a WaveNet implementation to play with, and this project in particular is really beautifully packaged and presented. So, first, thank you!

As for the issue: I can't get the basic "hello world" generation step to work. Using your recommended command --

python wavenet.py predict with models/run_2016-09-14_11:32:09/config.json predict_seconds=1

-- everything runs fine, with no errors, and I do get a wav file, but its content is just noise. I've tried several times with identical results; here's an example.

I'm running on Ubuntu 14.04 with a Titan X GPU.

Should I be expecting output similar to the sample wav included in the project? Any ideas for what I might try?

basveeling commented 7 years ago

Thanks for the heads up, I've updated the readme to include the sample_temperature=0.001 option, which should generate better sounding samples. The model weights provided in this repo are poorly trained due to lack of resources, so the predicted distributions are quite flat, resulting in white noise. I'll update the weights once I've had the time to train the model properly. And thanks for the kind words!

basveeling commented 7 years ago

Furthermore, you can try playing around with the code to use a different initial input. I'll add this as a configuration option when I have some more time :). -- edit: see predict_initial_input

robinsloan commented 7 years ago

Thanks for the reply! Adding sample_temperature does indeed produce something a little better.

Question for you: did you generate your included sample with the included model? I'm just trying to get to "hello world" to be sure it's working as intended on my setup here.

robinsloan commented 7 years ago

Just an update on this: I was able to generate samples comparable to the one included in the project by switching to the Theano backend, rather than TensorFlow. If anyone else finds themselves browsing this issue, the command is:

THEANO_FLAGS='lib.cnmem=1' KERAS_BACKEND=theano python wavenet.py predict <etc. etc.>

@basveeling, it might be worth noting somewhere in the README that users should specify the Theano backend for good results. Thanks again!