gcorso / DiffDock

Implementation of DiffDock: Diffusion Steps, Twists, and Turns for Molecular Docking
https://arxiv.org/abs/2210.01776
MIT License
1.09k stars 263 forks source link

ValueError: No edges and no nodes #237

Open srilekha1993 opened 4 months ago

srilekha1993 commented 4 months ago

Hi @jsilter, while running inference.py for pdbbind dataset on 363 complexes mentioned in testset_csv.csv sometimes throwing the below error

48it [49:44, 25.37s/it]--- Logging error --- Traceback (most recent call last): File "/home/hgx/omics/srilekhx/DiffDock-1.1.2/inference.py", line 261, in main data_list, confidence = sampling(data_list=data_list, model=model, File "/home/hgx/omics/srilekhx/DiffDock-1.1.2/utils/sampling.py", line 115, in sampling tr_score, rot_score, tor_score = model(mod_complex_graph_batch)[:3] File "/data/sudarsh2/miniconda3/envs/diff_L_new_rec/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1532, in _wrapped_call_impl return self._call_impl(*args, kwargs) File "/data/sudarsh2/miniconda3/envs/diff_L_new_rec/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1541, in call_impl return forward_call(*args, *kwargs) File "/home/hgx/omics/srilekhx/DiffDock-1.1.2/models/cg_model.py", line 318, in forward rec_edge_index, rec_edge_attr, rec_edge_sh, rec_edge_weight = self.embedding(data) File "/home/hgx/omics/srilekhx/DiffDock-1.1.2/models/cg_model.py", line 290, in embedding rec_node_attr = self.rec_emb_layers[l](rec_node_attr, data['receptor', 'receptor'].edge_index, edge_attr, rec_edge_sh, edge_weight=rec_edge_weight) File "/data/sudarsh2/miniconda3/envs/diff_L_new_rec/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1532, in _wrapped_call_impl return self._call_impl(args, kwargs) File "/data/sudarsh2/miniconda3/envs/diff_L_new_rec/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1541, in _call_impl return forward_call(*args, **kwargs) File "/home/hgx/omics/srilekhx/DiffDock-1.1.2/models/tensor_layers.py", line 311, in forward raise ValueError("No edges and no nodes") ValueError: No edges and no nodes

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/data/sudarsh2/miniconda3/envs/diff_L_new_rec/lib/python3.9/logging/init.py", line 1083, in emit msg = self.format(record) File "/data/sudarsh2/miniconda3/envs/diff_L_new_rec/lib/python3.9/logging/init.py", line 927, in format return fmt.format(record) File "/data/sudarsh2/miniconda3/envs/diff_L_new_rec/lib/python3.9/logging/init.py", line 663, in format record.message = record.getMessage() File "/data/sudarsh2/miniconda3/envs/diff_L_new_rec/lib/python3.9/logging/init.py", line 367, in getMessage msg = msg % self.args TypeError: not all arguments converted during string formatting Call stack: File "/data/sudarsh2/miniconda3/envs/diff_L_new_rec/lib/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/data/sudarsh2/miniconda3/envs/diff_L_new_rec/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/home/hgx/omics/srilekhx/DiffDock-1.1.2/inference.py", line 319, in main(_args) File "/home/hgx/omics/srilekhx/DiffDock-1.1.2/inference.py", line 303, in main logger.warning("Failed on", orig_complex_graph["name"], e) Message: 'Failed on' Arguments: (['6ott'], ValueError('No edges and no nodes'))

Please let me know what might be the issue for getting that error on inference.py on pdbbind dataset

zshivji commented 4 months ago

I am getting the same error...any suggestions?

tkella47 commented 4 months ago

I think the error comes from a cropping function https://github.com/gcorso/DiffDock/blob/6d065cd78c11a610a0f3eba30f836a7e3a04358f/utils/sampling.py#L108

navvye commented 2 months ago

Got the same error on the HF space (https://huggingface.co/spaces/reginabarzilaygroup/DiffDock-Web)


ValueError: No edges and no nodes

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/appuser/micromamba/envs/diffdock/lib/python3.9/logging/__init__.py", line 1083, in emit
    msg = self.format(record)
  File "/home/appuser/micromamba/envs/diffdock/lib/python3.9/logging/__init__.py", line 927, in format
    return fmt.format(record)
  File "/home/appuser/micromamba/envs/diffdock/lib/python3.9/logging/__init__.py", line 663, in format
    record.message = record.getMessage()
  File "/home/appuser/micromamba/envs/diffdock/lib/python3.9/logging/__init__.py", line 367, in getMessage
    msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
  File "/home/appuser/DiffDock/inference.py", line 318, in <module>
    main(_args)
  File "/home/appuser/DiffDock/inference.py", line 302, in main
    logger.warning("Failed on", orig_complex_graph["name"], e)
Message: 'Failed on'
Arguments: (['complex_0'], ValueError('No edges and no nodes'))