mirror of
https://github.com/malarinv/tacotron2
synced 2026-03-08 09:42:34 +00:00
Compare commits
1 Commits
padding-pa
...
single-gpu
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
723e869d4b |
@@ -1,4 +1,3 @@
|
|||||||
FROM pytorch/pytorch:0.4_cuda9_cudnn7
|
FROM pytorch/pytorch:0.4_cuda9_cudnn7
|
||||||
|
|
||||||
RUN pip install numpy scipy matplotlib librosa==0.6.0 tensorflow tensorboardX
|
RUN pip install numpy scipy matplotlib librosa==0.6.0 tensorflow tensorboardX inflect==0.2.5 Unidecode==1.0.22
|
||||||
inflect==0.2.5 Unidecode==1.0.22
|
|
||||||
|
|||||||
@@ -21,10 +21,10 @@ Distributed and FP16 support relies on work by Christian Sarofeen and NVIDIA's
|
|||||||
3. CD into this repo: `cd tacotron2`
|
3. CD into this repo: `cd tacotron2`
|
||||||
4. Update .wav paths: `sed -i -- 's,DUMMY,ljs_dataset_folder/wavs,g' filelists/*.txt`
|
4. Update .wav paths: `sed -i -- 's,DUMMY,ljs_dataset_folder/wavs,g' filelists/*.txt`
|
||||||
5. Install [pytorch 0.4](https://github.com/pytorch/pytorch)
|
5. Install [pytorch 0.4](https://github.com/pytorch/pytorch)
|
||||||
6. Install python requirements or build docker image
|
6. Install python requirements or use docker container (tbd)
|
||||||
- Install python requirements: `pip install requirements.txt`
|
- Install python requirements: `pip install requirements.txt`
|
||||||
- **OR**
|
- **OR**
|
||||||
- Build docker image: `docker build --tag tacotron2 .`
|
- Docker container `(tbd)`
|
||||||
|
|
||||||
## Training
|
## Training
|
||||||
1. `python train.py --output_directory=outdir --log_directory=logdir`
|
1. `python train.py --output_directory=outdir --log_directory=logdir`
|
||||||
|
|||||||
2
model.py
2
model.py
@@ -470,8 +470,8 @@ class Tacotron2(nn.Module):
|
|||||||
text_padded, input_lengths, mel_padded, gate_padded, \
|
text_padded, input_lengths, mel_padded, gate_padded, \
|
||||||
output_lengths = batch
|
output_lengths = batch
|
||||||
text_padded = to_gpu(text_padded).long()
|
text_padded = to_gpu(text_padded).long()
|
||||||
max_len = int(torch.max(input_lengths.data).numpy())
|
|
||||||
input_lengths = to_gpu(input_lengths).long()
|
input_lengths = to_gpu(input_lengths).long()
|
||||||
|
max_len = torch.max(input_lengths.data)
|
||||||
mel_padded = to_gpu(mel_padded).float()
|
mel_padded = to_gpu(mel_padded).float()
|
||||||
gate_padded = to_gpu(gate_padded).float()
|
gate_padded = to_gpu(gate_padded).float()
|
||||||
output_lengths = to_gpu(output_lengths).long()
|
output_lengths = to_gpu(output_lengths).long()
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
torch==0.2.0.post3
|
torch==0.2.0.post3
|
||||||
matplotlib==2.1.0
|
matplotlib==2.1.0
|
||||||
tensorflow
|
tensorflow==1.5.0
|
||||||
numpy==1.13.3
|
numpy==1.13.3
|
||||||
inflect==0.2.5
|
inflect==0.2.5
|
||||||
librosa==0.6.0
|
librosa==0.6.0
|
||||||
|
|||||||
2
utils.py
2
utils.py
@@ -5,7 +5,7 @@ import torch
|
|||||||
|
|
||||||
def get_mask_from_lengths(lengths):
|
def get_mask_from_lengths(lengths):
|
||||||
max_len = torch.max(lengths)
|
max_len = torch.max(lengths)
|
||||||
ids = torch.arange(0, max_len).long().cuda()
|
ids = torch.arange(0, max_len, out=torch.LongTensor(max_len)).cuda()
|
||||||
mask = (ids < lengths.unsqueeze(1)).byte()
|
mask = (ids < lengths.unsqueeze(1)).byte()
|
||||||
return mask
|
return mask
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user