You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
2.6 KiB

  1. # Tacotron 2 (without wavenet)
  2. Tacotron 2 PyTorch implementation of [Natural TTS Synthesis By Conditioning
  3. Wavenet On Mel Spectrogram Predictions](https://arxiv.org/pdf/1712.05884.pdf).
  4. This implementation includes **distributed** and **fp16** support
  5. and uses the [LJSpeech dataset](https://keithito.com/LJ-Speech-Dataset/).
  6. Distributed and FP16 support relies on work by Christian Sarofeen and NVIDIA's
  7. [Apex Library](https://github.com/nvidia/apex).
  8. ![Alignment, Predicted Mel Spectrogram, Target Mel Spectrogram](tensorboard.png)
  9. [Download demo audio](https://github.com/NVIDIA/tacotron2/blob/master/demo.wav) trained on LJS and using Ryuchi Yamamoto's [pre-trained Mixture of Logistics
  10. wavenet](https://github.com/r9y9/wavenet_vocoder/)
  11. "Scientists at the CERN laboratory say they have discovered a new particle."
  12. ## Pre-requisites
  13. 1. NVIDIA GPU + CUDA cuDNN
  14. ## Setup
  15. 1. Download and extract the [LJ Speech dataset](https://keithito.com/LJ-Speech-Dataset/)
  16. 2. Clone this repo: `git clone https://github.com/NVIDIA/tacotron2.git`
  17. 3. CD into this repo: `cd tacotron2`
  18. 4. Update .wav paths: `sed -i -- 's,DUMMY,ljs_dataset_folder/wavs,g' filelists/*.txt`
  19. - Alternatively, set `load_mel_from_disk=True` in `hparams.py` and update mel-spectrogram paths
  20. 5. Install [pytorch 0.4](https://github.com/pytorch/pytorch)
  21. 6. Install python requirements or build docker image
  22. - Install python requirements: `pip install -r requirements.txt`
  23. - **OR**
  24. - Build docker image: `docker build --tag tacotron2 .`
  25. ## Training
  26. 1. `python train.py --output_directory=outdir --log_directory=logdir`
  27. 2. (OPTIONAL) `tensorboard --logdir=outdir/logdir`
  28. ## Multi-GPU (distributed) and FP16 Training
  29. 1. `python -m multiproc train.py --output_directory=outdir --log_directory=logdir --hparams=distributed_run=True,fp16_run=True`
  30. ## Inference
  31. When performing Mel-Spectrogram to Audio synthesis with a WaveNet model, make sure Tacotron 2 and WaveNet were trained on the same mel-spectrogram representation. Follow these steps to use a a simple inference pipeline using griffin-lim:
  32. 1. `jupyter notebook --ip=127.0.0.1 --port=31337`
  33. 2. load inference.ipynb
  34. ## Related repos
  35. [nv-wavenet](https://github.com/NVIDIA/nv-wavenet/): Faster than real-time
  36. wavenet inference
  37. ## Acknowledgements
  38. This implementation uses code from the following repos: [Keith
  39. Ito](https://github.com/keithito/tacotron/), [Prem
  40. Seetharaman](https://github.com/pseeth/pytorch-stft) as described in our code.
  41. We are inspired by [Ryuchi Yamamoto's](https://github.com/r9y9/tacotron_pytorch)
  42. Tacotron PyTorch implementation.
  43. We are thankful to the Tacotron 2 paper authors, specially Jonathan Shen, Yuxuan
  44. Wang and Zongheng Yang.