snap-stanford / GEARS

GEARS is a geometric deep learning model that predicts outcomes of novel multi-gene perturbations
MIT License
189 stars 38 forks source link

Environments (versions of packages) to run GEARS #70

Open wcanisay-y opened 3 months ago

wcanisay-y commented 3 months ago

Would you please specify the versions of the listed packages in the requirements.txt file? I have a problem with the training function in model_tutorial.ipynb, and it seems to be a problem with the torch_geometrics package.

Start Training...

Unexpected exception formatting exception. Falling back to standard exception
Traceback (most recent call last):
  File "/home/anaconda3/envs/scrna/lib/python3.12/site-packages/IPython/core/interactiveshell.py", line 3553, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "/tmp/ipykernel_7637/2402802242.py", line 1, in <module>
    gears_model.train(epochs = 20, lr = 1e-3)
  File "/home/anaconda3/envs/scrna/lib/python3.12/site-packages/gears/gears.py", line 525, in train
    pred = self.model(batch)
           ^^^^^^^^^^^^^^^^^
  File "/home/anaconda3/envs/scrna/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1532, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/anaconda3/envs/scrna/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1541, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/anaconda3/envs/scrna/lib/python3.12/site-packages/gears/model.py", line 124, in forward
    x, pert_idx = data.x, data.pert_idx
                          ^^^^^^^^^^^^^
  File "/home/anaconda3/envs/scrna/lib/python3.12/site-packages/torch_geometric/data/data.py", line 559, in __getattr__
    f"'edge_index' contains negative indices in "
    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/anaconda3/envs/scrna/lib/python3.12/site-packages/torch_geometric/data/storage.py", line 96, in __getattr__
    if key[:1] == '_':
        ^^^^^^^^^^^^^^
AttributeError: 'GlobalStorage' object has no attribute 'pert_idx'