alphacep / vosk-tts

Text To Speech Synthesis with Vosk
Apache License 2.0
118 stars 18 forks source link

How to load pretrained model? #22

Closed ekaterina-poslavskaya closed 5 months ago

ekaterina-poslavskaya commented 5 months ago

Hi! Thanks for great models. I'd like to try to finetune with additional voice, but I can't load pretrained model: torch.load returns pickle error.

What has torch package been used for saving? (there is no requirements file in training catalog)

nshmyrev commented 5 months ago

We use torch 2.1. What is the pickle error exactly?

ekaterina-poslavskaya commented 5 months ago

I've got Error on loading pretrained model. This error catches by try..except and full train from empty model begans, not finetuning.

Exception has occurred: UnpicklingError invalid load key, 'v'. File "xxx/vosk-tts/training/utils.py", line 20, in load_checkpoint checkpoint_dict = torch.load(checkpoint_path, map_location='cpu') File "xxx/vosk-tts/training/trainfinetune.py", line 210, in run , , , _ = utils.load_checkpoint("training/pretrained/G_1000.pth", net_g, File "xxx/vosk-tts/training/train_finetune.py", line 61, in main run(0, n_gpus, hps) File "xxx/training/train_finetune.py", line 503, in main() _pickle.UnpicklingError: invalid load key, 'v'.

in requirements: torch = "==2.1.0"

nshmyrev commented 5 months ago

Are you sure you cloned the model properly? Likely you have issue with git lfs. Check the model size (G_1000.pth), if it is only 135 bytes you need to properly install lfs first.

ekaterina-poslavskaya commented 5 months ago

My bad! It works!