Open EdgyRoger opened 4 years ago
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]). 上面的图片好像显示不了,这里列一下文字。
请问您这个问题解决了吗。我在测试demo时候也遇到了同样的问题。
这种情况是因为你自己生成caption.pth的时候修改了一些参数,你下载作者给的caption.pth就不会出现这种问题了
作者大大你好,我这边在运行demo.ipynb文件时前面都能正常运行,但最后一个代码块报错:
好像是预训练模型的参数不匹配?但是网上查了很久也没有找到解决办法,能否帮我看看这个问题呢?感激不尽!