Skip to content

Commit

Permalink
Update Tacotron2+Waveglow checkpoints
Browse files Browse the repository at this point in the history
Signed-off-by: Rajeev Rao <rajeevrao@nvidia.com>
  • Loading branch information
rajeevsrao committed Nov 13, 2020
1 parent f83010e commit c796c84
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 15 deletions.
7 changes: 2 additions & 5 deletions demo/Tacotron2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@ Software version configuration tested for the instructions that follow:
2. Install prerequisite software for TTS sample:
```bash
cd $TRT_SOURCE/demo/Tacotron2

export LD_LIBRARY_PATH=$TRT_SOURCE/build/out:/tensorrt/lib:$LD_LIBRARY_PATH
pip3 install /tensorrt/python/tensorrt-7.2*-cp36-none-linux_x86_64.whl

bash ./scripts/install_prerequisites.sh
```
3. Download pretrained checkpoints from [NGC](https://ngc.nvidia.com/catalog/models) into the `./checkpoints` directory:
Expand All @@ -48,13 +45,13 @@ Software version configuration tested for the instructions that follow:

```bash
mkdir -p output
python3 exports/export_tacotron2_onnx.py --tacotron2 ./checkpoints/tacotron2pyt_fp16_v3/tacotron2_1032590_6000_amp -o output/ --fp16
python3 exports/export_tacotron2_onnx.py --tacotron2 ./checkpoints/tacotron2_pyt_ckpt_amp_v19.09.0/nvidia_tacotron2pyt_fp16_20190427 -o output/ --fp16
```

Export WaveGlow to ONNX IR:

```bash
python3 exports/export_waveglow_onnx.py --waveglow checkpoints/waveglow256pyt_fp16_v2/waveglow_1076430_14000_amp --wn-channels 256 -o output/ --fp16
python3 exports/export_waveglow_onnx.py --waveglow ./checkpoints/waveglow_ckpt_amp_256_v19.10.0/nvidia_waveglow256pyt_fp16 --wn-channels 256 -o output/ --fp16
```

After running the above commands, there should be four new ONNX files in `./output/` directory:
Expand Down
12 changes: 6 additions & 6 deletions demo/Tacotron2/scripts/download_checkpoints.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
mkdir -p checkpoints && cd checkpoints

# Download the Tacotron2 and Waveglow checkpoints
if [ ! -f "checkpoints/tacotron2pyt_fp16_v3/tacotron2_1032590_6000_amp" ]; then
echo "Downloading Tacotron2 fp16 checkpoint from NGC"
ngc registry model download-version nvidia/tacotron2pyt_fp16:3
if [ ! -f "checkpoints/tacotron2_pyt_ckpt_amp_v19.09.0/nvidia_tacotron2pyt_fp16_20190427" ]; then
echo "Downloading Tacotron2 checkpoint from NGC"
ngc registry model download-version nvidia/tacotron2_pyt_ckpt_amp:19.09.0
fi;
if [ ! -f "checkpoints/waveglow256pyt_fp16_v2/waveglow_1076430_14000_amp" ]; then
echo "Downloading Waveglow fp16 checkpoint from NGC"
ngc registry model download-version nvidia/waveglow256pyt_fp16:2
if [ ! -f "checkpoints/waveglow_ckpt_amp_256_v19.10.0/nvidia_waveglow256pyt_fp16" ]; then
echo "Downloading Waveglow checkpoint from NGC"
ngc registry model download-version nvidia/waveglow_ckpt_amp_256:19.10.0
fi;

cd -
2 changes: 1 addition & 1 deletion demo/Tacotron2/scripts/inference_benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
echo "TensorRT BS=1, S=128"
bash test_infer.sh --test trt/test_infer_trt.py -bs 1 -il 128 --fp16 --num-iters 1003 --encoder ./output/encoder_fp16.engine --decoder ./output/decoder_iter_fp16.engine --postnet ./output/postnet_fp16.engine --waveglow ./output/waveglow_fp16.engine --wn-channels 256
echo "PyTorch (GPU) BS=1, S=128"
bash test_infer.sh -bs 1 -il 128 --fp16 --num-iters 1003 --tacotron2 ./checkpoints/tacotron2pyt_fp16_v3/tacotron2_1032590_6000_amp --waveglow ./checkpoints/waveglow256pyt_fp16_v2/waveglow_1076430_14000_amp --wn-channels 256
bash test_infer.sh -bs 1 -il 128 --fp16 --num-iters 1003 --tacotron2 ./checkpoints/tacotron2_pyt_ckpt_amp_v19.09.0/nvidia_tacotron2pyt_fp16_20190427 --waveglow ./checkpoints/waveglow_ckpt_amp_256_v19.10.0/nvidia_waveglow256pyt_fp16 --wn-channels 256
2 changes: 1 addition & 1 deletion demo/Tacotron2/scripts/install_prerequisites.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

pip3 install numba==0.48 torch==1.4.0
pip3 install -r requirements.txt
sudo apt-get install -y libsndfile1
echo "nvidia" | sudo -S apt-get install -y libsndfile1

pushd /tmp
git clone https://github.com/NVIDIA/apex
Expand Down
4 changes: 2 additions & 2 deletions demo/Tacotron2/test_infer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
BATCH_SIZE=1
INPUT_LENGTH=128
NUM_ITERS=1003 # extra 3 iterations for warmup
TACOTRON2_CKPT="tacotron2_1032590_6000_amp"
WAVEGLOW_CKPT="waveglow_1076430_14000_amp"
TACOTRON2_CKPT="nvidia_tacotron2pyt_fp16_20190427"
WAVEGLOW_CKPT="nvidia_waveglow256pyt_fp16"
RUN_MODE="" # = fp32
LOG_RUN_MODE="gpu_fp32"
TEST_PROGRAM="test_infer.py"
Expand Down

0 comments on commit c796c84

Please sign in to comment.