uw-ipd / RoseTTAFold2

MIT License
167 stars 39 forks source link

RuntimeError: Sizes of tensors must match except in dimension 0 #21

Open wonyoungtae opened 1 year ago

wonyoungtae commented 1 year ago

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 commented 1 year ago

I think https://github.com/uw-ipd/RoseTTAFold2/blob/703d56ed95622e5e32675c89e038519b05683a85/network/predict.py#L214 should be Ls_blocked.append(msa_i.shape[1])

wonyoungtae commented 1 year ago

I think

https://github.com/uw-ipd/RoseTTAFold2/blob/703d56ed95622e5e32675c89e038519b05683a85/network/predict.py#L214

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 commented 1 year ago

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 commented 9 months ago

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.