maum-ai/univnet

mel channels

Closed this issue · 3 comments

hello,how can i change mel channels from 80 to 100 to use your model?

Hello, sorry for the late reply.

If you want to use Univnet with your own acoustic model, make sure your acoustic model uses the same mel configuration as Univnet.

For example, let's say if you want to use Tacotron2.
Then you should modify mel channels in this line from 80 to 100.
Then you have to train Tacotron2 with these configs.

Among acoustic models and vocoders, we recommend you to match the configs of the model, which takes less time to learn, to the pre-trained weights of other models.

thanks a lot

Alternatively, you can update input convolutions (init from scratch) and fine-tune the model to adjust your resolution. This should take less time for those who have limited computing.

 print("modifying kernels to increase mel resolution")
 cond_channels = 80 # or any of your resolution
 kpnet_hidden_channels = 64

 model_g.res_stack[0].kernel_predictor.input_conv = nn.Sequential(
   nn.utils.weight_norm(nn.Conv1d(cond_channels, kpnet_hidden_channels, 5, padding=2, bias=True)),
   nn.LeakyReLU(0.1),
)
    
model_g.res_stack[1].kernel_predictor.input_conv = nn.Sequential(
    nn.utils.weight_norm(nn.Conv1d(cond_channels, kpnet_hidden_channels, 5, padding=2, bias=True)),
    nn.LeakyReLU(0.1),
)

model_g.res_stack[2].kernel_predictor.input_conv = nn.Sequential(
    nn.utils.weight_norm(nn.Conv1d(cond_channels, kpnet_hidden_channels, 5, padding=2, bias=True)),
    nn.LeakyReLU(0.1),
)