Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

chapter 10 size mismatch when running demo.ipynb #209

Open
EdgyRoger opened this issue May 5, 2020 · 3 comments
Open

chapter 10 size mismatch when running demo.ipynb #209

EdgyRoger opened this issue May 5, 2020 · 3 comments

Comments

@EdgyRoger
Copy link

作者大大你好,我这边在运行demo.ipynb文件时前面都能正常运行,但最后一个代码块报错:
image
好像是预训练模型的参数不匹配?但是网上查了很久也没有找到解决办法,能否帮我看看这个问题呢?感激不尽!

@EdgyRoger
Copy link
Author

EdgyRoger commented May 5, 2020

RuntimeError: Error(s) in loading state_dict for CaptionModel:
size mismatch for classifier.weight: copying a param with shape torch.Size([10003, 256]) from checkpoint, the shape in current model is torch.Size([5003, 256]).
size mismatch for classifier.bias: copying a param with shape torch.Size([10003]) from checkpoint, the shape in current model is torch.Size([5003]).
size mismatch for embedding.weight: copying a param with shape torch.Size([10003, 256]) from checkpoint, the shape in current model is torch.Size([5003, 256]).
上面的图片好像显示不了,这里列一下文字。

@HN123-123
Copy link

请问您这个问题解决了吗。我在测试demo时候也遇到了同样的问题。

@wenshijie110
Copy link

这种情况是因为你自己生成caption.pth的时候修改了一些参数,你下载作者给的caption.pth就不会出现这种问题了

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

No branches or pull requests

3 participants