sokrypton / ColabFold

Making Protein folding accessible to all!
MIT License
1.92k stars 482 forks source link

TypeError: prediction_callback() takes 4 positional arguments but 5 were given #254

Open nmrworker opened 2 years ago

nmrworker commented 2 years ago

Expected Behavior

Recently when we attempted to run AF2 on a complex but failed with following error message. We then test it with a notebook we ran before and same error was generated. Please help and thanks in advance.

Current Behavior

Run Prediction generates error: TypeError Traceback (most recent call last) in () 51 pair_mode=pair_mode, 52 stop_at_score=float(100), ---> 53 prediction_callback=prediction_callback, 54 )

1 frames /usr/local/lib/python3.7/dist-packages/colabfold/batch.py in predict_structure(prefix, result_dir, feature_dict, is_complex, use_templates, sequences_lengths, crop_len, model_type, model_runner_and_params, do_relax, rank_by, random_seed, stop_at_score, stop_at_score_below, prediction_callback, use_gpu_relax) 418 prediction_result, 419 input_features, --> 420 (model_name, False), 421 ) 422

TypeError: prediction_callback() takes 4 positional arguments but 5 were given

Steps to Reproduce (for bugs)

ColabFold: AlphaFold2 using MMseqs2 Easy to use protein structure and complex prediction using AlphaFold2 and Alphafold2-multimer. Sequence alignments/templates are generated through MMseqs2 and HHsearch. For more details, see bottom of the notebook, checkout the ColabFold GitHub and read our manuscript. Old versions: v1.0, v1.1, v1.2, v1.3

Mirdita M, Schütze K, Moriwaki Y, Heo L, Ovchinnikov S, Steinegger M. ColabFold - Making protein folding accessible to all. bioRxiv, 2021

Input protein sequence(s), then hit Runtime -> Run all query_sequence: PGNWFQMVSAQERLTRTFTRSSHTYTRTERTEISKTRGGETKREVRVEESTQVGGDPFPAVFGDFLGRERLGSFGSITRQQEG

jobname: test99 use_amber: template_mode: none

MSA options (custom MSA upload, single sequence, pairing mode) msa_mode: MMseqs2 (UniRef+Environmental) pair_mode: unpaired+paired

Advanced settings model_type: auto num_recycles: 3

save_to_google_drive:

if the save_to_google_drive option was selected, the result zip will be uploaded to your Google Drive Don't forget to hit Runtime -> Run all after updating the form.

You are logged into Google Drive and are good to go!

ColabFold Output (for bugs)

Please make sure to also post the complete ColabFold output. You can use gist.github.com for large output.

Context

Providing context helps us come up with a solution and improve our documentation for the future.

Your Environment

Include as many relevant details about the environment you experienced the bug in.

karlhanf commented 2 years ago

Yes, I have hit what seems to be the same bug. I could submit it as a separate bug report if you like. Here is my report:

The notebook bit.ly/af-lab , with all default settings, is dying with a fatal error at the "Run prediction" step, whereas it worked a few weeks ago.

Steps:

  1. Go to bit.ly/af-lab
  2. Save As...
  3. Verify that Runtime:'Change runtime type' is set to GPU
  4. Leave all parameters as-is (including the defaults PIAQIHILEGRSDEQKETLIREVSEAISRSLDAPLTSVRVIITEMAKGHFGIGGELASK, MMseqs2, etc..)
  5. Run all.

A few differences that I see from my run in May 2022:

  1. In the first step ('pip install...'), parts of its output that are new since May 2022 include:

    ... WARNING: jax 0.3.8 does not provide the extra 'cuda11' ... ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. albumentations 0.1.12 requires imgaug<0.2.7,>=0.2.5, but you have imgaug 0.2.9 which is incompatible. ...

  2. In the 'Install dependencies' step, parts of its output that are new since May 2022 include:

    ... WARNING: jax 0.2.22 does not provide the extra 'cuda' ...

  3. The complete output of the 'Run prediction' step is:

    Downloading alphafold2 weights to .: 100%|██████████| 3.47G/3.47G [00:30<00:00, 122MB/s] 2022-06-30 20:15:04,478 Found 5 citations for tools or databases 2022-06-30 20:15:11,805 Query 1/1: test_a5e17 (length 59) COMPLETE: 100%|██████████| 150/150 [elapsed: 00:00 remaining: 00:00] 2022-06-30 20:15:12,885 Running model_1 2022-06-30 20:16:00,198 model_1 took 43.4s (3 recycles) with pLDDT 96.1 and ptmscore 0.756

    TypeError Traceback (most recent call last)

    in () 51 pair_mode=pair_mode, 52 stop_at_score=float(100), ---> 53 prediction_callback=prediction_callback, 54 ) /usr/local/lib/python3.7/dist-packages/colabfold/batch.py in run(queries, result_dir, num_models, num_recycles, model_order, is_complex, num_ensemble, model_type, msa_mode, use_templates, custom_template_path, use_amber, keep_existing_results, rank_by, pair_mode, data_dir, host_url, random_seed, stop_at_score, recompile_padding, recompile_all_models, zip_results, prediction_callback, save_single_representations, save_pair_representations, training, use_gpu_relax, stop_at_score_below, dpi, max_msa) 1383 prediction_callback=prediction_callback, 1384 use_gpu_relax=use_gpu_relax, -> 1385 random_seed=random_seed, 1386 ) 1387 except RuntimeError as e: /usr/local/lib/python3.7/dist-packages/colabfold/batch.py in predict_structure(prefix, result_dir, feature_dict, is_complex, use_templates, sequences_lengths, crop_len, model_type, model_runner_and_params, do_relax, rank_by, random_seed, stop_at_score, stop_at_score_below, prediction_callback, use_gpu_relax) 418 prediction_result, 419 input_features, --> 420 (model_name, False), 421 ) 422 TypeError: prediction_callback() takes 4 positional arguments but 5 were given
nmrworker commented 2 years ago

I figured it out the issue with my problem is that the current AlphaFold2.ipynb has this additional parameter "dpi = 200 #@param {type:"integer"} #@markdown - set dpi for image resolution" that was not in the old notebook I used to use. Once I use the current notebook, the problem no longer shows up. Hope this helps.

karlhanf commented 2 years ago

Thanks! With that tip, I searched afresh for an AlphaFold2 colab notebook, and I simply switched from what I was using ( https://bit.ly/af-lab -> https://colab.research.google.com/drive/1YqKkVemisr61NWNTJlYvtPYKFDtGrzdp?usp=sharing ) to ( https://colab.research.google.com/github/sokrypton/ColabFold/blob/main/AlphaFold2.ipynb ).