pyg与graphgym

一、配置问题:

我用的显卡是ti3090,为驱动算力,cuda用11.0

软件环境是torch1.8.0,此时注意,graphgym需要安装版本为0.3.0,否则会由于版本过高,导致各种出错。

如果要使用pyg,那么会容易遇到一个报错:

  File "d:\Programfile\graphgym\run\main_pyg.py", line 10, in
    from graphgym.loader_pyg import create_dataset, create_loader
  File "D:\Programfile\graphgym\gymenv\lib\site-packages\graphgym\loader_pyg.py", line 23, in      
    from torch_geometric.data.graph_saint import (GraphSAINTNodeSampler,
ModuleNotFoundError: No module named 'torch_geometric.data.graph_saint'

注意到,其实在环境里,是可以用grep在D:\Programfile\graphgym\gymenv\lib\site-packages\torch_geometric\data目录下找到【GraphSAINTNodeSampler】的。因此,直接更改loader_pyg.py,将以下代码更改为:

from torch_geometric.data.graph_saint import (GraphSAINTNodeSampler,
                                              GraphSAINTEdgeSampler,
                                              GraphSAINTRandomWalkSampler)
from torch_geometric.data.cluster import ClusterLoader
from torch_geometric.data.sampler import RandomNodeSampler, NeighborSampler


----------------------------------------------------------------------------------------


from torch_geometric.data import (GraphSAINTNodeSampler,
                                 GraphSAINTEdgeSampler,
                                 GraphSAINTRandomWalkSampler)
from torch_geometric.data import ClusterLoader
from torch_geometric.data import RandomNodeSampler, NeighborSampler

你可能感兴趣的:(斯坦福-cs224w,python)