divelab / DIG

A library for graph deep learning research
https://diveintographs.readthedocs.io/
GNU General Public License v3.0
1.81k stars 281 forks source link

Documentation Discrepancy: Incompatibility of DIG with PyTorch Geometric 2.3.0 #219

Open Qianli-Wu opened 11 months ago

Qianli-Wu commented 11 months ago

Hello,

I noticed an issue regarding the doc of DIG.

The doc states that DIG requires PyTorch Geometric (>=2.0.0). However, it seems that the DIG library is incompatible with PyTorch Geometric version 2.3.0.

In the 2.3.0 release of torch geometric, the API for the MessagePassing class was changed, as detailed in this commit. For example, the method __check_input__ was changed to _check_input`, which leads to incompatibility with certain lines in the DIG codebase, for instance: https://github.com/divelab/DIG/blob/97a726395f3ad1ed651658dd4d492a33e15929cd/dig/xgraph/models/models.py#L361-L362

https://github.com/divelab/DIG/blob/97a726395f3ad1ed651658dd4d492a33e15929cd/dig/xgraph/models/models.py#L367-L368 Also, the Dataset class was turned into an abstract class, requiring the implementation of two abstract methods len and get.

    @abstractmethod
    def len(self) -> int:
        r"""Returns the number of graphs stored in the dataset."""
        raise NotImplementedError

    @abstractmethod
    def get(self, idx: int) -> BaseData:
        r"""Gets the data object at index :obj:`idx`."""
        raise NotImplementedError

Consequently, classes such as MarginalSubgraphDataset need to implement these methods to function correctly: https://github.com/divelab/DIG/blob/97a726395f3ad1ed651658dd4d492a33e15929cd/dig/xgraph/method/shapley.py#L44-L64

This discrepancy might cause confusion for users attempting to install and use DIG with PyTorch Geometric 2.3.0.

GianninaL commented 4 months ago

Hi, I'm using PyTorch Geometric 2.4.0. and I'm still facing the same problem as described above. Currently, I'm trying to run the tutorial for SubgraphX. The visualization of the results of SubgraphX does not work and I get: "TypeError: Can't instantiate abstract class MarginalSubgraphDataset with abstract methods get, len" Could there be another problem?