open-mmlab / Amphion

Amphion (/æmˈfaɪən/) is a toolkit for Audio, Music, and Speech Generation. Its purpose is to support reproducible research and help junior researchers and engineers get started in the field of audio, music, and speech generation research and development.
https://openhlt.github.io/amphion/
MIT License
4.45k stars 379 forks source link

[Help]: Inference #142

Closed mysxs closed 6 months ago

mysxs commented 6 months ago

Problem Overview

In Amphion/bins/svc/inference.py, acoustics_dir is not assigned a value and is set to None. Is this correct? Because while debugging inference.py, I found that due to acoustics_dir being None, an error occurs at line 192 in Amphion/models/svc/base/svc_dataset.py: ``spk2id_path = os.path.join(args.acoustics_dir, cfg.preprocess.spk2id). The error message is TypeError: expected str, bytes, or os.PathLike object, not NoneType.

Steps Taken

Amphion/bins/svc/inference.py:

   parser.add_argument(
        "--acoustics_dir",
        type=str,
        help="Acoustics model checkpoint directory. If a directory is given, "
        "search for the latest checkpoint dir in the directory. If a specific "
        "checkpoint dir is given, directly load the checkpoint.",

)

Screenshots

image

RMSnow commented 6 months ago

Hi @mysxs, did you specify the --infer_expt_dir when inference? You can refer to this part as the instruction.

mysxs commented 6 months ago

Hi @RMSnow ,thank your apply,OK I fixed this issue and a new problem appeared: when I run the inference, an error is reported, and it is written in Amphion/models/base/new_inference.py that it says ckpt_list = [ckpt for ckpt in Path(vocoder_dir).glob("*.pt")] that need a .pt file, but I use Hifi-Gan, It doesn't have a .pt file, there are many .bin files, which .bin file should I specify?

Adorable-Qin commented 6 months ago

Hi @mysxs !

You may refer to issue 105 for the checkpoint loading problem.

We are going to provide an official update to solve this issue later. Before that, you could use our pretrained BigVGAN vocoder if you don't want to implement your own inference code.

You may find quick reference guides from our hugging face pages svc and vocoder.

If you have any other problem, feel free to contact us!

mysxs commented 6 months ago

Hi Adorable-Qin~ I have resolved the issue. Thank you for your response.

Adorable-Qin commented 6 months ago

Glad to hear that!

We will close this issue. Feel free to re-open it once you have other questions!