r9y9 / deepvoice3_pytorch

PyTorch implementation of convolutional neural networks-based text-to-speech synthesis models
https://r9y9.github.io/deepvoice3_pytorch/
Other
1.96k stars 482 forks source link

size mismatch for seq2seq.encoder.embed_tokens.weight #208

Open CathyW77 opened 4 years ago

CathyW77 commented 4 years ago

Hi, when I run
python synthesis.py --preset=presets/20180505_deepvoice3_ljspeech.json pretrained_models/20180505_deepvoice3_checkpoint_step000640000.pth sentences.txt pretrained_output

error: Command line args: {'--checkpoint-postnet': None, '--checkpoint-seq2seq': None, '--file-name-suffix': '', '--help': False, '--hparams': '', '--max-decoder-steps': '500', '--output-html': False, '--preset': 'presets/deepvoice3_vctk.json', '--replace_pronunciation_prob': '0.0', '--speaker_id': None, '': 'pretrained_models/20171222_deepvoice3_vctk108_checkpoint_step000300000.pth', '': './pretrained_output', '': './sentences.txt'} Traceback (most recent call last): File "synthesis.py", line 130, in model.load_state_dict(checkpoint["state_dict"]) File "/nfs/private/yanglu/zhrtvc/venv/lib/python3.6/site-packages/torch/nn/modules/module.py", line 769, in load_state_dict self.class.name, "\n\t".join(error_msgs))) RuntimeError: Error(s) in loading state_dict for MultiSpeakerTTSModel: size mismatch for seq2seq.encoder.embed_tokens.weight: copying a param with shape torch.Size([149, 256]) from checkpoint, the shape in current model is torch.Size([159, 256]).

it also comes out when I run : python synthesis.py --preset=presets/deepvoice3_vctk.json pretrained_models/20171222_deepvoice3_vctk108_checkpoint_step000300000.pth sentences.txt pretrained_output Command line args: {'--checkpoint-postnet': None, '--checkpoint-seq2seq': None, '--file-name-suffix': '', '--help': False, '--hparams': '', '--max-decoder-steps': '500', '--output-html': False, '--preset': 'presets/deepvoice3_vctk.json', '--replace_pronunciation_prob': '0.0', '--speaker_id': None, '': 'pretrained_models/20171222_deepvoice3_vctk108_checkpoint_step000300000.pth', '': 'pretrained_output', '': 'sentences.txt'} Traceback (most recent call last): File "synthesis.py", line 130, in model.load_state_dict(checkpoint["state_dict"]) File "/nfs/private/yanglu/zhrtvc/venv/lib/python3.6/site-packages/torch/nn/modules/module.py", line 769, in load_state_dict self.class.name, "\n\t".join(error_msgs))) RuntimeError: Error(s) in loading state_dict for MultiSpeakerTTSModel: size mismatch for seq2seq.encoder.embed_tokens.weight: copying a param with shape torch.Size([149, 256]) from checkpoint, the shape in current model is torch.Size([159, 256]).

ymzlygw commented 4 years ago

Hi, when I run python synthesis.py --preset=presets/20180505_deepvoice3_ljspeech.json pretrained_models/20180505_deepvoice3_checkpoint_step000640000.pth sentences.txt pretrained_output

error: Command line args: {'--checkpoint-postnet': None, '--checkpoint-seq2seq': None, '--file-name-suffix': '', '--help': False, '--hparams': '', '--max-decoder-steps': '500', '--output-html': False, '--preset': 'presets/deepvoice3_vctk.json', '--replace_pronunciation_prob': '0.0', '--speaker_id': None, '': 'pretrained_models/20171222_deepvoice3_vctk108_checkpoint_step000300000.pth', '': './pretrained_output', '': './sentences.txt'} Traceback (most recent call last): File "synthesis.py", line 130, in model.load_state_dict(checkpoint["state_dict"]) File "/nfs/private/yanglu/zhrtvc/venv/lib/python3.6/site-packages/torch/nn/modules/module.py", line 769, in load_state_dict self.class.name, "\n\t".join(error_msgs))) RuntimeError: Error(s) in loading state_dict for MultiSpeakerTTSModel: size mismatch for seq2seq.encoder.embed_tokens.weight: copying a param with shape torch.Size([149, 256]) from checkpoint, the shape in current model is torch.Size([159, 256]).

it also comes out when I run : python synthesis.py --preset=presets/deepvoice3_vctk.json pretrained_models/20171222_deepvoice3_vctk108_checkpoint_step000300000.pth sentences.txt pretrained_output Command line args: {'--checkpoint-postnet': None, '--checkpoint-seq2seq': None, '--file-name-suffix': '', '--help': False, '--hparams': '', '--max-decoder-steps': '500', '--output-html': False, '--preset': 'presets/deepvoice3_vctk.json', '--replace_pronunciation_prob': '0.0', '--speaker_id': None, '': 'pretrained_models/20171222_deepvoice3_vctk108_checkpoint_step000300000.pth', '': 'pretrained_output', '': 'sentences.txt'} Traceback (most recent call last): File "synthesis.py", line 130, in model.load_state_dict(checkpoint["state_dict"]) File "/nfs/private/yanglu/zhrtvc/venv/lib/python3.6/site-packages/torch/nn/modules/module.py", line 769, in load_state_dict self.class.name, "\n\t".join(error_msgs))) RuntimeError: Error(s) in loading state_dict for MultiSpeakerTTSModel: size mismatch for seq2seq.encoder.embed_tokens.weight: copying a param with shape torch.Size([149, 256]) from checkpoint, the shape in current model is torch.Size([159, 256]).

Hey, try don't use --preset params or change the correspond params in preset.

CathyW77 commented 4 years ago

@ymzlygw Hi, I have tried python synthesis.py pretrained_models/20180505_deepvoice3_checkpoint_step000640000.pth sentences.txt pretrained_output

still went error File "synthesis.py", line 130, in model.load_state_dict(checkpoint["state_dict"]) File "/nfs/private/yanglu/zhrtvc/venv/lib/python3.6/site-packages/torch/nn/modules/module.py", line 769, in load_state_dict self.class.name, "\n\t".join(error_msgs))) RuntimeError: Error(s) in loading state_dict for MultiSpeakerTTSModel: size mismatch for seq2seq.encoder.embed_tokens.weight: copying a param with shape torch.Size([149, 128]) from checkpoint, the shape in current model is torch.Size([159, 128]).