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: Sizes of tensors must match except in dimension 0 #21

Open
wonyoungtae opened this issue Sep 20, 2023 · 4 comments
Open

Comments

@wonyoungtae
Copy link

Hi, I'm trying to run model using an example file, but there's an error.
$ ../run_RF2.sh rcsb_pdb_8HBN.fasta -o 7UGF

Running HHblits
 -> Running command: /home/yt/RoseTTAFold2/input_prep/make_protein_msa.sh 7UGF/rcsb_pdb_8HBN_1.fa 7UGF rcsb_pdb_8HBN_1 8 64
Running HHblits
 -> Running command: /home/yt/RoseTTAFold2/input_prep/make_protein_msa.sh 7UGF/rcsb_pdb_8HBN_2.fa 7UGF rcsb_pdb_8HBN_2 8 64
Running RoseTTAFold2 to predict structures
 -> Running command: python /home/yt/RoseTTAFold2/network/predict.py -inputs 7UGF/rcsb_pdb_8HBN_1.msa0.a3m 7UGF/rcsb_pdb_8HBN_2.msa0.a3m  -prefix 7UGF/models/model -model /home/yt/RoseTTAFold2/network/weights/RF2_apr23.pt -db /home/yt/RoseTTAFold2/pdb100_2021Mar03/pdb100_2021Mar03 -symm C1
/home/yt/RoseTTAFold2/network/weights/RF2_apr23.pt
Running on GPU
Traceback (most recent call last):
  File "/home/yt/RoseTTAFold2/network/predict.py", line 493, in <module>
    pred.predict(
  File "/home/yt/RoseTTAFold2/network/predict.py", line 218, in predict
    msa_orig = merge_a3m_hetero(msa_orig, {'msa':msas[i],'ins':inss[i]}, [sum(Ls_blocked[:i]),Ls_blocked[i]])
  File "/home/yt/RoseTTAFold2/network/data_loader.py", line 531, in merge_a3m_hetero
    msa = torch.cat(msa, dim=0)
RuntimeError: Sizes of tensors must match except in dimension 0. Expected size 783 but got size 2647 for tensor number 1 in the list.

How can I solve this problem?

@yamule
Copy link

yamule commented Oct 1, 2023

I think

Ls_blocked.append(msa_i.shape[0])

should be
Ls_blocked.append(msa_i.shape[1])

@wonyoungtae
Copy link
Author

I think

Ls_blocked.append(msa_i.shape[0])

should be
Ls_blocked.append(msa_i.shape[1])

Isn't there a potential problem in randomly altering the given values in the code when it comes to prediction?

@yamule
Copy link

yamule commented Oct 5, 2023

There is a potential problem.
This repo is provided under the MIT license.
I declare that my proposal is also provided under the MIT license.
Please don't use it.
If there is someone who does the same thing with me, they would have done so independently of me.
Sorry for the inconvenience.

@GCS-ZHN
Copy link

GCS-ZHN commented Dec 29, 2023

Actually this example is a multimer and should add --pair parameter, but I am seeking for a solution to run may monomer seqs in a batch fasta.

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

3 participants