descriptinc / melgan-neurips

GAN-based Mel-Spectrogram Inversion Network for Text-to-Speech Synthesis
MIT License
964 stars 214 forks source link

Where can I find the args.yml for the models provided in models/ folder? #28

Closed donand closed 4 years ago

donand commented 4 years ago

Hello,

Where can I find the file args.yml for the models provided in models/ folder?

I tried to run the generate_from_folder.py script using the provided checkpoints linda_johnson.pt and multi_speaker.pt but it requires the args.yml file with some hyperparameters of the model.

def load_model(mel2wav_path, device=get_default_device()):
    """
    Args:
        mel2wav_path (str or Path): path to the root folder of dumped text2mel
        device (str or torch.device): device to load the model
    """
    root = Path(mel2wav_path)
    with open(root / "args.yml", "r") as f:
        args = yaml.load(f, Loader=yaml.FullLoader)
    netG = Generator(args.n_mel_channels, args.ngf, args.n_residual_layers).to(device)
    netG.load_state_dict(torch.load(root / "best_netG.pt", map_location=device))
    return netG

Needed parameters:

The line netG.load_state_dict(torch.load(root / "best_netG.pt", map_location=device)) tries to load the checkpoint named best_netG.pt, should I change this to multi_speaker.pt?

Thanks

donand commented 4 years ago

Solved, there is the github=True parameter in the MelVocoder class constructor.