Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot reproduce as good audios as the demo shows #45

Closed
liusongxiang opened this issue Mar 31, 2018 · 13 comments
Closed

Cannot reproduce as good audios as the demo shows #45

liusongxiang opened this issue Mar 31, 2018 · 13 comments

Comments

@liusongxiang
Copy link

Hi, @r9y9, thanks for sharing this great repo. I have run your code using CMU ARCTIC clb data to train a single-speaker wavenet. I think I have set all the model hparams as the same as you show on your demo website. But the test audios coming out of the 170k-step checkpoint still contain many noises. Below is the haprams, and I have made other codes untouched.
Hope you can help me, thanks.
input_type="mulaw",
quantize_channels=256, # 65536 or 256

# Audio:
sample_rate=16000,
# this is only valid for mulaw is True
silence_threshold=2,
num_mels=80,
fmin=125,
fmax=7600,
fft_size=1024,
# shift can be specified by either hop_size or frame_shift_ms
hop_size=256,
frame_shift_ms=None,
min_level_db=-100,
ref_level_db=20,
# whether to rescale waveform or not.
# Let x is an input waveform, rescaled waveform y is given by:
# y = x / np.abs(x).max() * rescaling_max
rescaling=True,
rescaling_max=0.999,
# mel-spectrogram is normalized to [0, 1] for each utterance and clipping may
# happen depends on min_level_db and ref_level_db, causing clipping noise.
# If False, assertion is added to ensure no clipping happens.o0
allow_clipping_in_normalization=True,

# Mixture of logistic distributions:
log_scale_min=float(np.log(1e-14)),

# Model:
# This should equal to `quantize_channels` if mu-law quantize enabled
# otherwise num_mixture * 3 (pi, mean, log_scale)
out_channels=10 * 3,
layers=16,
stacks=2,
residual_channels=512,
gate_channels=512,  # split into 2 gropus internally for gated activation
skip_out_channels=256,
dropout=1 - 0.95,
kernel_size=3,
# If True, apply weight normalization as same as DeepVoice3
weight_normalization=True,

# Local conditioning (set negative value to disable))
cin_channels=80,
# If True, use transposed convolutions to upsample conditional features,
# otherwise repeat features to adjust time resolution
upsample_conditional_features=True,
# should np.prod(upsample_scales) == hop_size
upsample_scales=[4, 4, 4, 4],
# Freq axis kernel size for upsampling network
freq_axis_kernel_size=3,

# Global conditioning (set negative value to disable)
# currently limited for speaker embedding
# this should only be enabled for multi-speaker dataset
gin_channels=-1,  # i.e., speaker embedding dim
n_speakers=7,  # 7 for CMU ARCTIC

# Data loader
pin_memory=True,
num_workers=2,

# train/test
# test size can be specified as portion or num samples
test_size=0.0441,  # 50 for CMU ARCTIC single speaker
test_num_samples=None,
random_state=1234,

# Loss

# Training:
batch_size=2,
adam_beta1=0.9,
adam_beta2=0.999,
adam_eps=1e-8,
initial_learning_rate=1e-3,
# see lrschedule.py for available lr_schedule
lr_schedule="noam_learning_rate_decay",
lr_schedule_kwargs={},  # {"anneal_rate": 0.5, "anneal_interval": 50000},
nepochs=2000,
weight_decay=0.0,
clip_thresh=-1,
# max time steps can either be specified as sec or steps
# This is needed for those who don't have huge GPU memory...
# if both are None, then full audio samples are used
max_time_sec=None,
max_time_steps=8000,
# Hold moving averaged parameters and use them for evaluation
exponential_moving_average=True,
# averaged = decay * averaged + (1 - decay) * x
ema_decay=0.9999,

# Save
# per-step intervals
checkpoint_interval=10000,
train_eval_interval=10000,
# per-epoch interval
test_eval_epoch_interval=5,
save_optimizer_state=True,
@r9y9
Copy link
Owner

r9y9 commented Mar 31, 2018

out_channels=10 * 3,

Just to make sure, this should be 256 in your case, right?

I'm wondering if exponential parameter averaging matters. It may improve quality of final model but will take more training time to converge than the case it's disabled. Can you try with the following parameters?

out_channels = 256
exponential_moving_average = False

Also, If you want to reproduce my experimental settings, try:

upsample_conditional_features = False
rescaling = False
fmin = 0
fmax = None

@liusongxiang
Copy link
Author

@r9y9 , Thank you very much! Yeah, I did use out_channels=10*3, sorry for the miss.
I will try your setting then.

@r9y9
Copy link
Owner

r9y9 commented Mar 31, 2018

Ah, you need another important change:

input_type="mulaw-quantize",

@liusongxiang
Copy link
Author

Yeah, It's right! I guess I should go over though all your codes first. Thank you very much!

@liusongxiang
Copy link
Author

@r9y9 Apologise for having so many questions. I used your codes, your hparams settings and the checkpoints to synthesise LJspeech wavs. However, the quality is not as good again as your demo shows. Attached is some generated wavs. Eager to see your suggestions.
Show appreciation in advance.
Shaun.
generated.zip

@r9y9
Copy link
Owner

r9y9 commented Apr 21, 2018

You might want to try fineturning your model. As I mention at #1 (comment), I did finetune the model many times. i.e., train 200k steps -> (change some hyper param and let's see how it works) -> train 200k step (lr starts from initial value) -> ... repeated. This might lead faster convergence. As far as I remember correctly I trained the model over 1000k steps.

@liusongxiang
Copy link
Author

I retrained. The performance is relatively good now. Thank you!

@duvtedudug
Copy link

train 200k step (lr starts from initial value) ->

@r9y9 so if you stop, then start again from checkpoint, the learning rate resets to initial scheme?

@r9y9
Copy link
Owner

r9y9 commented Apr 28, 2018

Yes exactly.

@duvtedudug
Copy link

Ah okay, that explains why the loss can jump up, then settle back down again. Thanks!

@duvtedudug
Copy link

(change some hyper param and let's see how it works)

@r9y9 can you give an example of what changes you made? i.e. what kind of lr made good progress?

@r9y9
Copy link
Owner

r9y9 commented Apr 30, 2018

I was trying to find a good value for

log_scale_min=float(np.log(1e-14)),
. Others were not changed as far as I remember correctly.

@r9y9
Copy link
Owner

r9y9 commented May 12, 2018

I'm closing this. Feel free to reopen if you still see the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants