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

size mismatch when load chembl-pretrained ckpt #51

Open
wuyongyi opened this issue Nov 23, 2023 · 0 comments
Open

size mismatch when load chembl-pretrained ckpt #51

wuyongyi opened this issue Nov 23, 2023 · 0 comments

Comments

@wuyongyi
Copy link

can not load pretrained ckpt, and set strict = False does not help.

python generate.py --vocab vocab.txt --model ckpt/chembl-pretrained/model.ckpt --nsample 1000
/root/miniconda3/lib/python3.7/site-packages/torch/nn/_reduction.py:44: UserWarning: size_average and reduce args will be deprecated, please use reduction='sum' instead.
warnings.warn(warning.format(ret))
Traceback (most recent call last):
File "generate.py", line 44, in
model.load_state_dict(torch.load(args.model)[0] , strict = False)
File "/root/miniconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1045, in load_state_dict
self.class.name, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for HierVAE:
size mismatch for encoder.E_c.0.weight: copying a param with shape torch.Size([1578, 250]) from checkpoint, the shape in current model is torch.Size([1576, 250]).
size mismatch for encoder.E_i.0.weight: copying a param with shape torch.Size([5623, 250]) from checkpoint, the shape in current model is torch.Size([5625, 250]).
size mismatch for decoder.hmpn.E_c.0.weight: copying a param with shape torch.Size([1578, 250]) from checkpoint, the shape in current model is torch.Size([1576, 250]).
size mismatch for decoder.hmpn.E_i.0.weight: copying a param with shape torch.Size([5623, 250]) from checkpoint, the shape in current model is torch.Size([5625, 250]).
size mismatch for decoder.E_assm.0.weight: copying a param with shape torch.Size([5623, 250]) from checkpoint, the shape in current model is torch.Size([5625, 250]).
size mismatch for decoder.clsNN.3.weight: copying a param with shape torch.Size([1578, 250]) from checkpoint, the shape in current model is torch.Size([1576, 250]).
size mismatch for decoder.clsNN.3.bias: copying a param with shape torch.Size([1578]) from checkpoint, the shape in current model is torch.Size([1576]).
size mismatch for decoder.iclsNN.3.weight: copying a param with shape torch.Size([5623, 250]) from checkpoint, the shape in current model is torch.Size([5625, 250]).
size mismatch for decoder.iclsNN.3.bias: copying a param with shape torch.Size([5623]) from checkpoint, the shape in current model is torch.Size([5625]).

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

1 participant