Closed DavideBuffelli closed 2 years ago
Dear Davide,
Thanks for this report. I am sorry you are running into these issues. I cannot comment on all instances individually, but I think that Python should be at least version 3.8 for all this to work. A few of the instances that you tried out appear to me to be code incompatibilities (torch/torch-geometric etc.).
Your first install script seems to go in the right direction! The error that you are getting indicates that torch-sparse
was not installed with proper linker dependencies. What I would try first here is the following:
torch-sparse
installationwheel
version: pip install --no-cache-dir torch-sparse -f https://data.pyg.org/whl/torch-1.8.1+cu111.html
You could also replace the torch
and torch-geometric
installation here by the following:
$ pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu111
$ pip install torch-scatter torch-sparse torch-cluster torch-spline-conv torch-geometric -f https://data.pyg.org/whl/torch-1.8.1+cu111.html
Unless I am mistaken, this should be better aligned with your CUDA installation!
Please let me know whether this works!
Thank you very much for your help. I was able to align torch and torch geometric, but the error then moved to the torch_persistent_homology code:
Traceback (most recent call last):
File "topognn/train_model.py", line 12, in <module>
import topognn.models as models
File "/mnt/TOGL_og/topognn/models.py", line 15, in <module>
from topognn.layers import GCNLayer, GINLayer, GATLayer, SimpleSetTopoLayer, fake_persistence_computation#, EdgeDropout
File "/mnt/TOGL_og/topognn/layers.py", line 8, in <module>
from torch_persistent_homology.persistent_homology_cpu import compute_persistence_homology_batched_mt
ImportError: /root/.cache/pypoetry/virtualenvs/topognn-6MuqOE4b-py3.8/lib/python3.8/site-packages/torch_persistent_homology/persistent_homology_cpu.cpython-38-x86_64-linux-gnu.so: undefined symbol: _ZNK2at10TensorBase8data_ptrIdEEPT_v
Is there any specific option I should pass during the installation of the torch_persistent_homology
repository? I tried removing it and reinstalling, but it didn't help.
Thank you again for your help.
Hi, I was finally able to get the code to work after discarding poetry, and updating the code to work with the latest version of PyTorch and PyG. There is however one bug that needs to be solved: in https://github.com/BorgwardtLab/TOGL/blob/2b47e647ec722dee936f3c7be4c1b74e437d2f07/topognn/models.py#L309
topo1
is an instance of TopologyLayer
, which outputs a tuple of 3 elements in its forward pass, not two. Would it be correct to do the following:
x, x_dim1, _ = self.topo1(x, data)
So the torch_persistent_homology
issues are best rectified by rebuilding locally. I'm afraid that all these linker errors indicate potential issues with the build process. I am sorry that I cannot be more specific here, but I lack the insight into your system.
Concerning the bug that you are mentioning, the workaround is correct. Is this raised from the current large GCN model? If this works, let's close the issue. If not, let's reopen another one to track the bug.
Hi, I was finally able to get the code to work after discarding poetry, and updating the code to work with the latest version of PyTorch and PyG.
Hi @DavideBuffelli , how did you solve the following error?
AttributeError: 'GlobalStorage' object has no attribute '__slices__'
in other words, how to replace something like batch.__slices__['x']
, since in pyg there is not this attribute?
Many thanks
Hi @dgm2, yes the correct attribute for newer versions of PyG is:
batch._slice_dict['x']
Can you mention the versions you are using here? We might want to update this at some point.
Yes, I tried it on PyG 2.0.4
Hi, I am sorry in advance for the long post, but I am having a lot of issues installing this repository, and I would highly appreciate any help you can provide.
I am trying to install this code on a machine with Linux 20.04.3 and CUDA 11.1.
The first thing I tried was to follow exactly the instructions you provide, so I did:
but I get the following error:
I thought the error could be that the Pytorch Geometric libraries are installed for CUDA 11.0 and not 11.1 as in my machine, so I modified the dep.py file accordingly and reinstalled everything, but I then got the following error:
At this point I thought I should try installing without using poetry, as it seems to be messing up the installation of PyTorch and PyG (specially the CUDA versions). I then did the following:
When I run
python topognn/train_model.py --model TopoGNN --dataset ENZYMES --max_epochs 10
The code finally starts, but as soon as it enters the training loop, I get the following error:I thought the issue could be that the version of PyTorch Geometric that is installed this way is not the one you have in your poetry.lock file, so I then redid this same procedure but installed
torch-geometric==1.6.3
. However I then get the error:I then tried to install PyG from pip instead of from conda:
But I then get:
At this point I was desperate and then tried to just install the CPU version, first like this:
which leads to
And finally like this:
which leads to
Is there something wrong that I am doing, or have you encountered some of these issues before?