Skip to content

[HiFiGAN/PyTorch] Number of Mel filters should be configurable, but it is hard coded in hifigan/models.py #1254

@itamar-dw

Description

@itamar-dw

Related to HiFiGAN/PyTorch

Describe the bug
The number of Mel filters is configurable in HiFiGAN/train.py, using the input arguments. However, in the file HiFiGAN/hifigan/models.py, where the HiFiGAN model is defined, this number is hard-coded to the default of 80. So any non-default value will raise an error. There are 2 places:

Conv1d(80, conf.upsample_initial_channel, 7, 1, padding=3))

mel_input = mel_init((1, 80, 88), dtype=w.dtype, device=w.device)

To Reproduce
Run the training code (train.py) with non-default value of --num_mels argumnet.

To Fix

  1. In HiFiGAN/models.py:get_moel_config method, add the value of args.num_mels to the model_config dictionary
  2. In Generator class from the file hifigan/models.py (line 151), use the value from the config (instead of the hard coded "80")
  3. Repeat for the Denoiser class from same file (line 250)

Environment

  • Container version : pytorch 21.12-py3
  • GPUs in the system : 8x A40
  • CUDA driver version : 11.8

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions