chrisdonahue / wavegan

WaveGAN: Learn to synthesize raw audio with generative adversarial networks
MIT License
1.32k stars 283 forks source link

Scipy cannot resample audio , is there any preprocessing required for wav files? although I did use --data_fast_wav as suggested in the documentation #33

Closed PriyanshJalan closed 5 years ago

PriyanshJalan commented 5 years ago

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "train_wavegan.py", line 650, in train(fps, args) File "train_wavegan.py", line 200, in train sess.run(D_train_op) File "/home/s1878561/.local/lib/python3.7/site-packages/tensorflow/python/training/monitored_session.py", line 676, in run run_metadata=run_metadata) File "/home/s1878561/.local/lib/python3.7/site-packages/tensorflow/python/training/monitored_session.py", line 1171, in run run_metadata=run_metadata) File "/home/s1878561/.local/lib/python3.7/site-packages/tensorflow/python/training/monitored_session.py", line 1270, in run raise six.reraise(original_exc_info) File "/opt/anaconda3/lib/python3.7/site-packages/six.py", line 693, in reraise raise value File "/home/s1878561/.local/lib/python3.7/site-packages/tensorflow/python/training/monitored_session.py", line 1255, in run return self._sess.run(args, *kwargs) File "/home/s1878561/.local/lib/python3.7/site-packages/tensorflow/python/training/monitored_session.py", line 1327, in run run_metadata=run_metadata) File "/home/s1878561/.local/lib/python3.7/site-packages/tensorflow/python/training/monitored_session.py", line 1091, in run return self._sess.run(args, **kwargs) File "/home/s1878561/.local/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 929, in run run_metadata_ptr) File "/home/s1878561/.local/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1152, in _run feed_dict_tensor, options, run_metadata) File "/home/s1878561/.local/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1328, in _do_run run_metadata) File "/home/s1878561/.local/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1348, in _do_call raise type(e)(node_def, op, message) tensorflow.python.framework.errors_impl.UnimplementedError: NotImplementedError: Scipy cannot resample audio. Traceback (most recent call last):

File "/home/s1878561/.local/lib/python3.7/site-packages/tensorflow/python/ops/script_ops.py", line 207, in call ret = func(*args)

File "/home/s1878561/wavegan/loader.py", line 128, in fast_wav=decode_fast_wav)

File "/home/s1878561/wavegan/loader.py", line 25, in decode_audio raise NotImplementedError('Scipy cannot resample audio.')

NotImplementedError: Scipy cannot resample audio.

chrisdonahue commented 5 years ago

You are trying to train a model at a different sample rate than your audio files. You have three options:

1) Resample all of your audio files to your intended GAN sampling rate 2) Change the sample rate of the model with --data_sample_rate, which will change the length of the generated audio accordingly 3) Use librosa to load and resample audio files instead by removing the --data_fast_wav flag.