diff --git a/autogl/module/model/dgl/__init__.py b/autogl/module/model/dgl/__init__.py index 00c78b5..b203ba8 100644 --- a/autogl/module/model/dgl/__init__.py +++ b/autogl/module/model/dgl/__init__.py @@ -3,7 +3,7 @@ from .base import BaseModel from .topkpool import AutoTopkpool -from .graph_saint import GraphSAINTAggregationModel +# from .graph_saint import GraphSAINTAggregationModel from .gcn import GCN, AutoGCN from .graphsage import GraphSAGE, AutoSAGE from .gat import GAT,AutoGAT @@ -14,7 +14,7 @@ __all__ = [ "register_model", "BaseModel", "AutoTopkpool", - "GraphSAINTAggregationModel", + # "GraphSAINTAggregationModel", "GCN", "AutoGCN", "GraphSAGE", diff --git a/autogl/module/train/__init__.py b/autogl/module/train/__init__.py index cacdc8d..7a4d1e7 100644 --- a/autogl/module/train/__init__.py +++ b/autogl/module/train/__init__.py @@ -1,3 +1,5 @@ +from ...backend import DependentBackend + TRAINER_DICT = {} from .base import ( BaseTrainer, @@ -24,7 +26,10 @@ def register_trainer(name): from .graph_classification_full import GraphClassificationFullTrainer from .node_classification_full import NodeClassificationFullTrainer -from .link_prediction import LinkPredictionTrainer +if DependentBackend.is_pyg(): + from .link_prediction import LinkPredictionTrainer +elif DependentBackend.is_dgl(): + LinkPredictionTrainer = None from .node_classification_trainer import * from .evaluation import get_feval, Acc, Auc, Logloss, Mrr, MicroF1 diff --git a/docs/requirements.txt b/docs/requirements.txt index d33bcad..9216223 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -13,11 +13,11 @@ requests scikit-learn scipy tabulate -https://download.pytorch.org/whl/lts/1.8/cpu/torch-1.8.1%2Bcpu-cp36-cp36m-linux_x86_64.whl -https://pytorch-geometric.com/whl/torch-1.8.0+cpu/torch_cluster-1.5.9-cp36-cp36m-linux_x86_64.whl -https://pytorch-geometric.com/whl/torch-1.8.0+cpu/torch_scatter-2.0.6-cp36-cp36m-linux_x86_64.whl -https://pytorch-geometric.com/whl/torch-1.8.0+cpu/torch_sparse-0.6.10-cp36-cp36m-linux_x86_64.whl -https://pytorch-geometric.com/whl/torch-1.8.0+cpu/torch_spline_conv-1.2.1-cp36-cp36m-linux_x86_64.whl -torch-geometric +# https://download.pytorch.org/whl/lts/1.8/cpu/torch-1.8.1%2Bcpu-cp36-cp36m-linux_x86_64.whl +# https://pytorch-geometric.com/whl/torch-1.8.0+cpu/torch_cluster-1.5.9-cp36-cp36m-linux_x86_64.whl +# https://pytorch-geometric.com/whl/torch-1.8.0+cpu/torch_scatter-2.0.6-cp36-cp36m-linux_x86_64.whl +# https://pytorch-geometric.com/whl/torch-1.8.0+cpu/torch_sparse-0.6.10-cp36-cp36m-linux_x86_64.whl +# https://pytorch-geometric.com/whl/torch-1.8.0+cpu/torch_spline_conv-1.2.1-cp36-cp36m-linux_x86_64.whl +# torch-geometric tqdm nni \ No newline at end of file diff --git a/setup.py b/setup.py index bd53a23..e78c790 100644 --- a/setup.py +++ b/setup.py @@ -6,30 +6,6 @@ except ModuleNotFoundError: "Please appropriately install PyTorch, " "see https://pytorch.org/ for installation." ) -try: - import torch_scatter - import torch_sparse - import torch_geometric - PYG_VER = torch_geometric.__version__.split('.') - PYG_VER = [int(PYG_VER[0]), int(PYG_VER[1])] - assert PYG_VER >= [1, 7], "PyTorch-Geometric version should be at least 1.7.0" -except ModuleNotFoundError: - raise ModuleNotFoundError( - "PyTorch-Geometric not fully installed. " - "Please appropriately install PyTorch-Geometric, " - "see https://pytorch-geometric.readthedocs.io/en/latest/notes/installation.html for installation." - ) - -if torch.__version__.startswith('1.8.'): - try: - import torch_cluster - import torch_spline_conv - except ModuleNotFoundError: - raise ModuleNotFoundError( - "PyTorch-Geometric not fully installed. " - "For PyTorch version 1.8.x, you should also install torch_cluster and torch_spline_conv " - "see https://pytorch-geometric.readthedocs.io/en/latest/notes/installation.html for installation." - ) from setuptools import setup, find_packages @@ -77,9 +53,6 @@ setup( 'scipy', 'tabulate', 'torch', - 'torch-geometric', - 'torch-scatter', - 'torch-sparse', 'tqdm', 'nni' ]