patrickbryant1 / SpeedPPI

Rapid protein-protein interaction network creation from multiple sequence alignments with Deep Learning
Other
71 stars 16 forks source link

SpeedPPI terminates with error: Cannot reshape a tensor with 2024432 elements to shape [4363,471,1] (2054973 elements) #30

Open Rohit-Satyam opened 8 hours ago

Rohit-Satyam commented 8 hours ago

Hi @patrickbryant1

I am trying to run SpeedPPI for two fasta files. Fasta1 contains a single protein, whereas fasta2 contain 2000 proteins sequences. So I decided to use some.vs.some script. However, I am getting the following error and the script always fails when predicting interaction for the subsequent pair:

fasta2 MRLWLIVCFLFLLSNNFIWAKQDDEVRKNKRYMLRKKFKNKKIHIMENEPNKIFLQVQSKHIYDPTGVFRDMHNFALGASTIYFSRLMWGAIIFVIMFILVSIIGIYLYVDNLENTLSHKNKHHKNVMNHYIVNPNPMHN fasta1 MKIHYINILLFELPLNILIYNQRNHKSTTPHTPNHTQTTRLLCECELYSPANNDNDAEMKRVMQQFEDRTTQRFHEYDERMKTTRQKCKEQCDKEIQKIILKDKLEKELMDKFATLQTDIQSDSIPTCICEKSLEDKVEKGCLRCAGVLGGGIAPGWSLVSGLGYAVWTNYVTQTALQKGIEAGVKAGIEGLRDFSGLGKLIPISVIQNLINHTNYDIAKTYITFVKSVNSTKCAVKEHSFCFSTYISNENALSKRAAGIAEYAADMAKITERGVLDAATPGLTTYSNAITASVVAIVVIVLVMIIIYLILRYRRKKKMKKKLQYIKLLEE

Traceback (most recent call last):
  File "/ibex/scratch/projects/c2077/rohit/SpeedPPI/./src/run_alphafold_some_vs_some.py", line 311, in <module>
    main(num_ensemble=1,
  File "/ibex/scratch/projects/c2077/rohit/SpeedPPI/./src/run_alphafold_some_vs_some.py", line 269, in main
    processed_feature_dict = model_runner.process_features(
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/ibex/scratch/projects/c2077/rohit/SpeedPPI/src/alphafold/model/model.py", line 102, in process_features
    return features.np_example_to_features(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/ibex/scratch/projects/c2077/rohit/SpeedPPI/src/alphafold/model/features.py", line 91, in np_example_to_features
    tensor_dict = proteins_dataset.np_to_tensor_dict(
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/ibex/scratch/projects/c2077/rohit/SpeedPPI/src/alphafold/model/tf/proteins_dataset.py", line 165, in np_to_tensor_dict
    tensor_dict = parse_reshape_logic(tensor_dict, features_metadata)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/ibex/scratch/projects/c2077/rohit/SpeedPPI/src/alphafold/model/tf/proteins_dataset.py", line 104, in parse_reshape_logic
    parsed_features[k] = tf.reshape(v, new_shape, name="reshape_%s" % k)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/ibex/scratch/projects/c2077/rohit/miniconda/envs/speed_ppi/lib/python3.12/site-packages/tensorflow/python/ops/weak_tensor_ops.py", line 88, in wrapper
    return op(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "/ibex/scratch/projects/c2077/rohit/miniconda/envs/speed_ppi/lib/python3.12/site-packages/tensorflow/python/util/traceback_utils.py", line 153, in error_handler
    raise e.with_traceback(filtered_tb) from None
  File "/ibex/scratch/projects/c2077/rohit/miniconda/envs/speed_ppi/lib/python3.12/site-packages/tensorflow/python/framework/ops.py", line 1056, in _create_c_op
    raise ValueError(e.message)
ValueError: Cannot reshape a tensor with 2024432 elements to shape [4363,471,1] (2054973 elements) for '{{node reshape_msa}} = Reshape[T=DT_INT32, Tshape=DT_INT32](Const_6, reshape_msa/shape)' with input shapes: [4363,464], [3] and with input tensors computed as partial shapes: input[1] = [4363,471,1].

Running it on HPC with

SBATCH --gpus=2

SBATCH --cpus-per-task=40

Rohit-Satyam commented 3 hours ago

I tried the predict_single.sh with 150GB of memory and for some reason, it worked.