-
Notifications
You must be signed in to change notification settings - Fork 30
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: shape '[31, 147]' is invalid for input of size 651 in extracting embbeding from pdb files #59
Comments
Hi, I'm wondering how you use the |
Hello! I am running into the same issue as above. I am using the graph_construction_model as used in the torchprotein tutorial. However, I run into the same import error as above. When I run the same code but using the downloaded EC proteins from the tutorial, I don't run into this issue. Is this to do with incorrect use of the data.Protein.from_pdb function? My code is as below (I'm reading in a pdb downloaded from rcsb).
And the error readout is
|
Hi! I think the error is that you forget to set |
I am following the tutorial and having the equivalent issue on the The graph has attributes Relevant dimensions from the convolution are:
and we get
Note that 350 * 147 gives a size of 51,450, and 51450 / 21 gives 2450, which matches the update dimension. So the mismatch is we expect input_dim = 21 (number of amino acids), but we have 67. I have copied the protein transforms and graph construction verbatum from tutorial:
What might be the problem here? |
Hi, sorry for the confusion. Could you please check again whether you pass the |
You are correct -- turns out in the process of fixing something else, I was passing in my transform object to my the I re-added that back in and got this working. Thank you! |
Thank you for your great work.
When I followed the method in the previous issue to implement feature extraction for pdb files, I encountered the following problem.
Traceback (most recent call last): File "script\tcr_extract.py", line 48, in <module> output = gearnet_edge(protein, protein.node_feature.float(), all_loss=None, metric=None) File "C:\Users\mercy\anaconda3\envs\proj_v1\lib\site-packages\torch\nn\modules\module.py", line 1130, in _call_impl return forward_call(*input, **kwargs) File "C:\Users\mercy\anaconda3\envs\proj_v1\lib\site-packages\torchdrug\models\gearnet.py", line 95, in forward hidden = self.layers[i](graph, layer_input) File "C:\Users\mercy\anaconda3\envs\proj_v1\lib\site-packages\torch\nn\modules\module.py", line 1130, in _call_impl return forward_call(*input, **kwargs) File "C:\Users\mercy\anaconda3\envs\proj_v1\lib\site-packages\torchdrug\layers\conv.py", line 91, in forward update = self.message_and_aggregate(graph, input) File "C:\Users\mercy\anaconda3\envs\proj_v1\lib\site-packages\torchdrug\layers\conv.py", line 813, in message_and_aggregate return update.view(graph.num_node, self.num_relation * self.input_dim) RuntimeError: shape '[31, 147]' is invalid for input of size 651
I used exactly the same code as in the issue, just modified the pthfile to mc_gearnet_edge.pth. The error appears on the last line.
output = gearnet_edge(protein, protein.node_feature.float(), all_loss=None, metric=None)
The pdb file I used had 31 residues. In this error, I guessed that 651 of them were 31*21. But I don't know why this is the case. I hope I can get some help. I have been troubled by this problem for a week. Thanks for all.
The text was updated successfully, but these errors were encountered: