zixiiu / Digital_Life_Server

Yet another voice assistant, but alive.
MIT License
2.47k stars 465 forks source link

使用VITS-fast-fine-tuning项目训练了自己的模型,放入项目运行下面报错。 #78

Closed WellTung666 closed 1 year ago

WellTung666 commented 1 year ago

使用VITS-fast-fine-tuning项目训练了自己的模型,放入项目运行下面报错,请问要怎么解决呢? 谢谢~

2023-07-25 16:13:49,858 ERROR Traceback (most recent call last):
  File "E:\work\Digital_Life_Server\SocketServer.py", line 199, in <module>
    s = Server(args)
        ^^^^^^^^^^^^
  File "E:\work\Digital_Life_Server\SocketServer.py", line 89, in __init__
    self.tts = TTService.TTService(*self.char_name[args.character])
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\work\Digital_Life_Server\TTS\TTService.py", line 42, in __init__
    _ = utils.load_checkpoint(model, self.net_g, None)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\work\Digital_Life_Server\TTS\vits\utils.py", line 40, in load_checkpoint
    model.load_state_dict(new_state_dict)
  File "D:\Program\Anaconda3\envs\life\Lib\site-packages\torch\nn\modules\module.py", line 2041, 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 enc_p.emb.weight: copying a param with shape torch.Size([50, 192]) from checkpoint, the shape in current model is torch.Size([52, 192]).

Traceback (most recent call last):
  File "E:\work\Digital_Life_Server\SocketServer.py", line 204, in <module>
    raise e
  File "E:\work\Digital_Life_Server\SocketServer.py", line 199, in <module>
    s = Server(args)
        ^^^^^^^^^^^^
  File "E:\work\Digital_Life_Server\SocketServer.py", line 89, in __init__
    self.tts = TTService.TTService(*self.char_name[args.character])
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\work\Digital_Life_Server\TTS\TTService.py", line 42, in __init__
    _ = utils.load_checkpoint(model, self.net_g, None)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\work\Digital_Life_Server\TTS\vits\utils.py", line 40, in load_checkpoint
    model.load_state_dict(new_state_dict)
  File "D:\Program\Anaconda3\envs\life\Lib\site-packages\torch\nn\modules\module.py", line 2041, in load_state_dict
    rai
WellTung666 commented 1 year ago

已解决~