You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And here is the error I encoutered which is reproducible in both python 2.7 and python 3.7, pytorch version 0.4.1
While copying the parameter named digit_capsules.route_weights, whose dimensions in the model are torch.Size([1, 736, 8, 16]) and whose dimensions in the checkpoint are torch.Size([1, 1248, 8, 16]), ...
Traceback (most recent call last):
File "prediction_emb.py", line 78, in
obse,pred1=pred_from_model(conv1,conv1,round1model,RTtest,15)
File "prediction_emb.py", line 17, in pred_from_model
model.load_state_dict(torch.load(param_path))
File "/home/yanglu/anaconda2/envs/dl_env/lib/python2.7/site-packages/torch/nn/modules/module.py", line 360, in load_state_dict
own_state[name].copy_(param)
RuntimeError: inconsistent tensor size, expected tensor [1 x 736 x 8 x 16] and src [1 x 1248 x 8 x 16] to have the same number of elements, but got 94208 and 159744 elements respectively at /opt/conda/conda-bld/pytorch_1503966894950/work/torch/lib/TH/generic/THTensorCopy.c:86
The text was updated successfully, but these errors were encountered:
Hi, because here "dia" and "mod" are two different data sets with different maximum peptide lengths (66 vs. 50), please simply change line #16 in config.py to be:
max_length = 66
And while making prediction using another trained model, just change this value to be the max peptide length in that data set (e.g. 50 in "mod" data).
I am making prediction using the trained models. I used the following command:
python prediction_emb.py 100 param/dia_all_epo20_dim24_conv10/dia_all_epo20_dim24_conv10_filled.pt 10 data/mod.txt
And here is the error I encoutered which is reproducible in both python 2.7 and python 3.7, pytorch version 0.4.1
While copying the parameter named digit_capsules.route_weights, whose dimensions in the model are torch.Size([1, 736, 8, 16]) and whose dimensions in the checkpoint are torch.Size([1, 1248, 8, 16]), ...
Traceback (most recent call last):
File "prediction_emb.py", line 78, in
obse,pred1=pred_from_model(conv1,conv1,round1model,RTtest,15)
File "prediction_emb.py", line 17, in pred_from_model
model.load_state_dict(torch.load(param_path))
File "/home/yanglu/anaconda2/envs/dl_env/lib/python2.7/site-packages/torch/nn/modules/module.py", line 360, in load_state_dict
own_state[name].copy_(param)
RuntimeError: inconsistent tensor size, expected tensor [1 x 736 x 8 x 16] and src [1 x 1248 x 8 x 16] to have the same number of elements, but got 94208 and 159744 elements respectively at /opt/conda/conda-bld/pytorch_1503966894950/work/torch/lib/TH/generic/THTensorCopy.c:86
The text was updated successfully, but these errors were encountered: