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

RuntimeError: size mismatch for digit_capsules.route_weights #3

Open
markmipt opened this issue Oct 23, 2018 · 1 comment
Open

RuntimeError: size mismatch for digit_capsules.route_weights #3

markmipt opened this issue Oct 23, 2018 · 1 comment

Comments

@markmipt
Copy link

Hi!

I would like to try your software and started with simplest thing from tutorial: "5. Make prediction using the trained models".

My running command is:
python3 prediction_emb_cpu.py 30 param_cpu/dia_all_epo20_dim24_conv10/dia_all_epo20_dim24_conv10_filled.pt 10 ~/DeepRT_test/test.txt ,
where test.txt contains only headers (sequence and RT) and single raw (PEPTIDE and 0). All separated by tab.

But I've got an error:
Traceback (most recent call last): File "prediction_emb_cpu.py", line 83, in <module> obse,pred1=pred_from_model(conv1,conv1,round1model,RTtest,15) File "prediction_emb_cpu.py", line 17, in pred_from_model model.load_state_dict(torch.load(param_path)) File "/home/mark/virtualenv_deepRT/lib/python3.7/site-packages/torch/nn/modules/module.py", line 719, in load_state_dict self.__class__.__name__, "\n\t".join(error_msgs))) RuntimeError: Error(s) in loading state_dict for CapsuleNet: size mismatch for digit_capsules.route_weights: copying a param of torch.Size([1, 736, 8, 16]) from checkpoint, where the shape is torch.Size([1, 1248, 8, 16]) in current model.

What I'm doing wrong here?

Regards,
Mark

@horsepurve
Copy link
Owner

Hello Mark,

This is due to the inconsistency between the maximum lengths of DIA data and your test data, so please (1) modify max_length to be 66 in config.py, (2) include at least two peptides in test.txt. Sorry for any inconvenience.

Best,
Chunwei

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

2 participants