r9y9 / wavenet_vocoder

WaveNet vocoder
https://r9y9.github.io/wavenet_vocoder/
Other
2.3k stars 500 forks source link

_pad_2d bug in the stable version v0.1.1. #181

Open lmxyy opened 4 years ago

lmxyy commented 4 years ago

I found the _pad_2d still didn't work in the stable version v0.1.1 as mentioned in #127 when training an unconditional Wavenet. I think the following snip in train.py

if is_mulaw_quantize(hparams.input_type):
        padding_value = P.mulaw_quantize(0, mu=hparams.quantize_channels)
        x_batch = np.array([_pad_2d(np_utils.to_categorical(
            x[0], num_classes=hparams.quantize_channels),
            max_input_len, padding_value) for x in batch], dtype=np.float32)

is somewhat wrong and should be

if is_mulaw_quantize(hparams.input_type):
        padding_value = P.mulaw_quantize(0, mu=hparams.quantize_channels - 1)
        x_batch = np.array([_pad_2d(to_categorical(
            x[0], num_classes=hparams.quantize_channels),
            max_input_len, 0, padding_value) for x in batch], dtype=np.float32)

in the branch master.

I am wondering which version I should use to train an unconditional Wavenet. I am a little confused because you mentioned that the v0.1.1 is the working version and branch master may not be working.