MockingBird 训练的时候出问题 RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( RuntimeError: Error(s) in loading state_dict for Tacotron:

tvmytwxo  于 2022-11-02  发布在  其他
关注(0)|答案(1)|浏览(939)

执行命令
python synthesizer_train.py mandarin {自己的路径}\SV2TTS\synthesizer

_characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890!'(),-.:;? '
报错
File "synthesizer_train.py", line 37, in
train(**vars(args))
File "D:\ai\MockingBird-main\MockingBird-main\synthesizer\train.py", line 122, in train
model.load(weights_fpath, device, optimizer)
File "D:\ai\MockingBird-main\MockingBird-main\synthesizer\models\tacotron.py", line 548, in load
self.load_state_dict(checkpoint["model_state"], strict=False)
File "D:\Anaconda3\envs\MB\lib\site-packages\torch\nn\modules\module.py", line 1497, in load_state_dict
raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for Tacotron:
size mismatch for encoder.embedding.weight: copying a param with shape torch.Size([70, 512]) from checkpoint, the shape in current model is torch.Size([75, 512]).
size mismatch for encoder_proj.weight: copying a param with shape torch.Size([128, 512]) from checkpoint, the shape in current model is torch.Size([128, 1024]).


_characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890!'(),-.:;? '
报错
File "synthesizer_train.py", line 37, in
train(**vars(args))
File "D:\ai\MockingBird-main\MockingBird-main\synthesizer\train.py", line 122, in train
model.load(weights_fpath, device, optimizer)
File "D:\ai\MockingBird-main\MockingBird-main\synthesizer\models\tacotron.py", line 548, in load
self.load_state_dict(checkpoint["model_state"], strict=False)
File "D:\Anaconda3\envs\MB\lib\site-packages\torch\nn\modules\module.py", line 1497, in load_state_dict
raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for Tacotron:
size mismatch for encoder_proj.weight: copying a param with shape torch.Size([128, 512]) from checkpoint, the shape in current model is torch.Size([128, 1024]).
size mismatch for decoder.attn_rnn.weight_ih: copying a param with shape torch.Size([384, 768]) from checkpoint, the shape in current model is torch.Size([384, 1280]).


use_gst = False, 和 use_ser_for_gst = False,
报错
File "synthesizer_train.py", line 37, in
train(**vars(args))
File "D:\ai\MockingBird-main\MockingBird-main\synthesizer\train.py", line 122, in train
model.load(weights_fpath, device, optimizer)
File "D:\ai\MockingBird-main\MockingBird-main\synthesizer\models\tacotron.py", line 548, in load
self.load_state_dict(checkpoint["model_state"], strict=False)
File "D:\Anaconda3\envs\MB\lib\site-packages\torch\nn\modules\module.py", line 1497, in load_state_dict
raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for Tacotron:
size mismatch for encoder_proj.weight: copying a param with shape torch.Size([128, 512]) from checkpoint, the shape in current model is torch.Size([128, 1024]).
size mismatch for decoder.attn_rnn.weight_ih: copying a param with shape torch.Size([384, 768]) from checkpoint, the shape in current model is torch.Size([384, 1280]).
size mismatch for decoder.rnn_input.weight: copying a param with shape torch.Size([1024, 640]) from checkpoint, the shape in current model is torch.Size([1024, 1152]).

相关问题