myshell-ai / MeloTTS

High-quality multi-lingual text-to-speech library by MyShell.ai. Support English, Spanish, French, Chinese, Japanese and Korean.
MIT License
3.97k stars 473 forks source link

When infer the local model, RuntimeError: Error(s) in loading state_dict for SynthesizerTrn #109

Open SRbone opened 2 months ago

SRbone commented 2 months ago

model = TTS(language='ZH_MIX_EN', device='cpu') File "D:\melo\api.py", line 60, in init self.model.load_state_dict(checkpoint_dict['model'], strict=True) File "C:\Users\lib\site-packages\torch\nn\modules\module.py", line 2152, in load_state_dict raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( RuntimeError: Error(s) in loading state_dict for SynthesizerTrn: size mismatch for emb_g.weight: copying a param with shape torch.Size([256, 256]) from checkpoint, the shape in current model is torch.Size([1, 256]).