alphafold icon indicating copy to clipboard operation
alphafold copied to clipboard

TypeError: tuple indices must be integers or slices, not str

Open DrJesseHansen opened this issue 1 year ago • 9 comments

Hi all,

I have resubmitted the same job as my previous issue, except this time on GeForce RTX 2080 Ti rather than A10 or A40s (under the assumption that these latter two need to have drivers updated). This gave a new error below.

thanks in advance!

I0406 08:08:54.468482 23367702087488 templates.py:256] Found an exact template match 2hxp_A.
I0406 08:08:54.631971 23367702087488 templates.py:256] Found an exact template match 4bvx_B.
I0406 08:08:54.644156 23367702087488 pipeline.py:234] Uniref90 MSA size: 36 sequences.
I0406 08:08:54.644257 23367702087488 pipeline.py:235] BFD MSA size: 36 sequences.
I0406 08:08:54.644309 23367702087488 pipeline.py:236] MGnify MSA size: 3 sequences.
I0406 08:08:54.644356 23367702087488 pipeline.py:237] Final (deduplicated) MSA size: 75 sequences.
I0406 08:08:54.644787 23367702087488 pipeline.py:239] Total number of templates (NB: this can include bad templates and is later filtered to top 4): 20.
I0406 08:08:54.674234 23367702087488 run_alphafold.py:216] Running model model_1_multimer_v3_pred_0 on test_multi
I0406 08:08:54.674847 23367702087488 model.py:138] Running predict with shape(feat) = {'aatype': (480,), 'residue_index': (480,), 'seq_length': (), 'msa': (512, 480), 'num_alignments': (), 'template_aatype': (4, 480), 'template_all_atom_mask': (4, 480, 37), 'template_all_atom_positions': (4, 480, 37, 3), 'asym_id': (480,), 'sym_id': (480,), 'entity_id': (480,), 'deletion_matrix': (512, 480), 'deletion_mean': (480,), 'all_atom_mask': (480, 37), 'all_atom_positions': (480, 37, 3), 'assembly_num_chains': (), 'entity_mask': (480,), 'num_templates': (), 'cluster_bias_mask': (512,), 'bert_mask': (512, 480), 'seq_mask': (480,), 'msa_mask': (512, 480)}
I0406 08:17:29.640328 23367702087488 model.py:201] Output shape was {'aligned_confidence_probs': (480, 480, 64), 'distogram': {'bin_edges': (63,), 'logits': (480, 480, 64)}, 'experimentally_resolved': {'logits': (480, 37)}, 'iptm': (), 'masked_msa': {'logits': (508, 480, 22)}, 'max_predicted_aligned_error': (), 'mean_plddt': (), 'plddt': (480,), 'predicted_aligned_error': (480, 480), 'predicted_lddt': {'logits': (480, 50)}, 'ptm': (), 'ranking_confidence': (), 'structure_module': {'final_atom_mask': (480, 37), 'final_atom_positions': (480, 37, 3)}, 'tol': ()}
I0406 08:17:29.641377 23367702087488 run_alphafold.py:228] Total JAX model model_1_multimer_v3_pred_0 on test_multi predict time (includes compilation time, see --benchmark): 515.0s
Traceback (most recent call last):
  File "/mnt/nfs/clustersw/Debian/bullseye/cuda/11.2/alphafold/2.3.4/alphafold-2.3.4/run_alphafold.py", line 468, in <module>
    app.run(main)
  File "/mnt/nfs/clustersw/Debian/bullseye/cuda/11.2/alphafold/2.3.4/lib/python3.9/site-packages/absl/app.py", line 312, in run
    _run_main(main, args)
  File "/mnt/nfs/clustersw/Debian/bullseye/cuda/11.2/alphafold/2.3.4/lib/python3.9/site-packages/absl/app.py", line 258, in _run_main
    sys.exit(main(argv))
  File "/mnt/nfs/clustersw/Debian/bullseye/cuda/11.2/alphafold/2.3.4/alphafold-2.3.4/run_alphafold.py", line 443, in main
    predict_structure(
  File "/mnt/nfs/clustersw/Debian/bullseye/cuda/11.2/alphafold/2.3.4/alphafold-2.3.4/run_alphafold.py", line 242, in predict_structure
    plddt = prediction_result['plddt']
TypeError: tuple indices must be integers or slices, not str

DrJesseHansen avatar Apr 06 '23 06:04 DrJesseHansen

Hi! Has the code been adapted at all? There is no 2.3.4 tag.

Htomlinson14 avatar Apr 06 '23 10:04 Htomlinson14

I got the same error below. Has anyone figured out how to fix this? Thanks.

Traceback (most recent call last): File "/apps/eb/AlphaFold/2.3.4-foss-2022a-CUDA-11.7.0-ColabFold/bin/alphafold", line 507, in app.run(main) File "/apps/eb/jax/0.3.25-foss-2022a-CUDA-11.7.0/lib/python3.10/site-packages/absl/app.py", line 308, in run _run_main(main, args) File "/apps/eb/jax/0.3.25-foss-2022a-CUDA-11.7.0/lib/python3.10/site-packages/absl/app.py", line 254, in _run_main sys.exit(main(argv)) File "/apps/eb/AlphaFold/2.3.4-foss-2022a-CUDA-11.7.0-ColabFold/bin/alphafold", line 488, in main predict_structure( File "/apps/eb/AlphaFold/2.3.4-foss-2022a-CUDA-11.7.0-ColabFold/bin/alphafold", line 283, in predict_structure plddt = prediction_result['plddt'] TypeError: tuple indices must be integers or slices, not str

Doscinco avatar Sep 15 '23 13:09 Doscinco

Can you provide more details of what and how you are running thing?

Looks like there is mention of colabfold in the error message...

sokrypton avatar Sep 15 '23 13:09 sokrypton

I am running AlphaFold 2.3.4, which was installed with EasyBuild on a Rocky 8 Linux cluster. Thanks.

"This package of AlphaFold contains patches for ColabFold."

https://docs.easybuild.io/version-specific/supported-software/#alphafold

Doscinco avatar Sep 15 '23 14:09 Doscinco

DrJesseHansen did you ever resolve this issue? Same TypeError as my runs.

JD-Crick avatar Nov 03 '23 10:11 JD-Crick

yes, but unfortunately I don't recall how. We had tons of errors during that time and eventually all got resolved. Are you running the latest ver of AF2? I remember upgrading helped a lot.

DrJesseHansen avatar Nov 06 '23 12:11 DrJesseHansen

Hi, thanks for the response. Alphafold is installed on my workplace's cluster so I am not in control of updating it. We currently run "AlphaFold/2.3.4-foss-2022a-CUDA-11.7.0-ColabFold" which I believe is the latest iteration. Others in my workplace are getting the same error.

JD-Crick avatar Nov 07 '23 11:11 JD-Crick

Hi there,

exact same error here, on all submitted jobs. Using AlphaFold/2.3.4-foss-2022a-CUDA-11.7.0-ColabFold.

Command:

alphafold  \
  --fasta_paths=${input} \
  --max_template_date=2023-03-10 \
  --db_preset=full_dbs \
  --data_dir ${ALPHAFOLD_DATA_DIR}\
  --model_preset=multimer \
  --output_dir ${outdir}

Error:

I0206 23:12:05.705442 22790460397376 model.py:201] Output shape was {'aligned_confidence_probs': (1066, 1066, 64), 'distogram': {'bin_edges': (63,), 'logits': (1066, 1066, 64)}, 'experimentally_resolved': {'logits': (1066, 37)}, 'iptm': (), 'masked_msa': {'logits': (508, 1066, 22)}, 'max_predicted_aligned_error': (), 'mean_plddt': (), 'plddt': (1066,), 'predicted_aligned_error': (1066, 1066), 'predicted_lddt': {'logits': (1066, 50)}, 'ptm': (), 'ranking_confidence': (), 'structure_module': {'final_atom_mask': (1066, 37), 'final_atom_positions': (1066, 37, 3)}, 'tol': ()}
I0206 23:12:05.706495 22790460397376 alphafold:269] Total JAX model model_1_multimer_v3_pred_0 on XXXX predict time (includes compilation time, see --benchmark): 252.4s
Traceback (most recent call last):
  File "/apps/gent/RHEL8/cascadelake-volta-ib/software/AlphaFold/2.3.4-foss-2022a-CUDA-11.7.0-ColabFold/bin/alphafold", line 507, in <module>
    app.run(main)
  File "/apps/gent/RHEL8/cascadelake-volta-ib/software/jax/0.3.25-foss-2022a-CUDA-11.7.0/lib/python3.10/site-packages/absl/app.py", line 308, in run
    _run_main(main, args)
  File "/apps/gent/RHEL8/cascadelake-volta-ib/software/jax/0.3.25-foss-2022a-CUDA-11.7.0/lib/python3.10/site-packages/absl/app.py", line 254, in _run_main
    sys.exit(main(argv))
  File "/apps/gent/RHEL8/cascadelake-volta-ib/software/AlphaFold/2.3.4-foss-2022a-CUDA-11.7.0-ColabFold/bin/alphafold", line 488, in main
    predict_structure(
  File "/apps/gent/RHEL8/cascadelake-volta-ib/software/AlphaFold/2.3.4-foss-2022a-CUDA-11.7.0-ColabFold/bin/alphafold", line 283, in predict_structure
    plddt = prediction_result['plddt']
TypeError: tuple indices must be integers or slices, not str

Going to try a previous version for now, but fixes are welcome.

Regards Mattias

mvheetve avatar Feb 07 '24 11:02 mvheetve

Also getting this on AlphaFold/2.3.4-foss-2022a-CUDA-11.7.0-ColabFold built with EasyBuild

gaspode avatar Mar 14 '24 10:03 gaspode