Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

使用train训练出来的模型在demo中加载失败 #40

Open
Barry1915 opened this issue Feb 22, 2022 · 1 comment
Open

使用train训练出来的模型在demo中加载失败 #40

Barry1915 opened this issue Feb 22, 2022 · 1 comment

Comments

@Barry1915
Copy link

RuntimeError: Error(s) in loading state_dict for CRNN:
size mismatch for rnn.0.rnn.weight_ih_l0: copying a param with shape torch.Size([512, 512]) from checkpoint, the shape in current model is torch.Size([1024, 512]).
size mismatch for rnn.0.rnn.weight_hh_l0: copying a param with shape torch.Size([512, 128]) from checkpoint, the shape in current model is torch.Size([1024, 256]).
size mismatch for rnn.0.rnn.bias_ih_l0: copying a param with shape torch.Size([512]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for rnn.0.rnn.bias_hh_l0: copying a param with shape torch.Size([512]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for rnn.0.rnn.weight_ih_l0_reverse: copying a param with shape torch.Size([512, 512]) from checkpoint, the shape in current model is torch.Size([1024, 512]).
size mismatch for rnn.0.rnn.weight_hh_l0_reverse: copying a param with shape torch.Size([512, 128]) from checkpoint, the shape in current model is torch.Size([1024, 256]).
size mismatch for rnn.0.rnn.bias_ih_l0_reverse: copying a param with shape torch.Size([512]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for rnn.0.rnn.bias_hh_l0_reverse: copying a param with shape torch.Size([512]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for rnn.0.embedding.weight: copying a param with shape torch.Size([77, 256]) from checkpoint, the shape in current model is torch.Size([37, 512]).
size mismatch for rnn.0.embedding.bias: copying a param with shape torch.Size([77]) from checkpoint, the shape in current model is torch.Size([37]).

@Barry1915
Copy link
Author

他这上面说的是训练出来的模型的参数与demo中初始化的模型的参数数量都不匹配,我就纳闷了,都是用的同一个crnn网络训练,怎么就不匹配了?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant