sarulab-speech / UTMOS22

UT-Sarulab MOS prediction system using SSL models
MIT License
169 stars 12 forks source link

Inference bug #15

Closed gongchenghhu closed 1 year ago

gongchenghhu commented 1 year ago

I followed the following command:

git clone https://huggingface.co/spaces/sarulab-speech/UTMOS-demo
cd UTMOS-demo
pip install -r requirements.txt
python predict.py --mode predict_file --inp_path /path/to/wav/file.wav --out_path /path/to/csv/file.csv

But I encountered a bug:

2023-10-01 16:16:07 | INFO | fairseq.tasks.text_to_speech | Please install tensorboardX: pip install tensorboardX
Using device: cuda
Traceback (most recent call last):
  File "predict.py", line 86, in <module>
    main()
  File "predict.py", line 57, in main
    scorer = Score(ckpt_path=args.ckpt_path, input_sample_rate=sr, device=device)
  File "/home/others/v-cheng-gong/Low_resources_languages/UTMOS-demo/score.py", line 24, in __init__
    self.model = lightning_module.BaselineLightningModule.load_from_checkpoint(
  File "/home/others/v-cheng-gong/anaconda3/envs/UTMOS/lib/python3.8/site-packages/pytorch_lightning/core/saving.py", line 134, in load_from_checkpoint
    checkpoint = pl_load(checkpoint_path, map_location=lambda storage, loc: storage)
  File "/home/others/v-cheng-gong/anaconda3/envs/UTMOS/lib/python3.8/site-packages/pytorch_lightning/utilities/cloud_io.py", line 38, in load
    return torch.load(f, map_location=map_location)
  File "/home/others/v-cheng-gong/anaconda3/envs/UTMOS/lib/python3.8/site-packages/torch/serialization.py", line 713, in load
    return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
  File "/home/others/v-cheng-gong/anaconda3/envs/UTMOS/lib/python3.8/site-packages/torch/serialization.py", line 920, in _legacy_load
    magic_number = pickle_module.load(f, **pickle_load_args)
_pickle.UnpicklingError: invalid load key, 'v'.

What did I do wrong? I found that the ckpt file is very small: 135 Oct 1 16:12 'epoch=3-step=7459.ckpt' Looking forward to your reply, thank you.

gongchenghhu commented 1 year ago

I have downloaded the large file from https://huggingface.co/spaces/sarulab-speech/UTMOS-demo/tree/main. But still not work.

gongchenghhu commented 1 year ago

I have solved by

git lfs install
git clone https://huggingface.co/spaces/sarulab-speech/UTMOS-demo

Thanks.