1.连接谷歌colab
from google.colab import drive
drive.mount('/content/gdrive')
2.安装相关的包,版本要对应好,注意卸载掉之前的tf,可能存在版本不对应问题
!pip install keras==2.1.0
!pip uninstall -y tensorflow
!pip install tensorflow-gpu==1.14.0
3.找到相关路径,以及数据集的路径,同时要修改原本py文件中引用数据集的相对路径
import os
import sys
path1="/content/gdrive/MyDrive/keras-gat-master"
os.chdir(path1)
os.listdir(path1)
sys.path.append('/content/gdrive/MyDrive/keras-gat-master/data')
4.运行py文件
!python gat.py
一部分的运行结果如下:

谷歌colab的文件存储如下:

from google.colab import drive
drive.mount('/content/gdrive')
!pip install dgl-cu101 dglgo -f https://data.dgl.ai/wheels/repo.html
!pip install keras==2.2.4
!pip install ogb==1.3.3
!pip uninstall pytorch
!pip install torch==1.8.1+cu101 torchvision==0.9.1+cu101 torchaudio==0.8.1 -f https://download.pytorch.org/whl/torch_stable.html
import os
import sys
path1="/content/gdrive/MyDrive/no-sampling"
os.chdir(path1)
os.listdir(path1)
sys.path.append('/content/gdrive/MyDrive/no-sampling/dataset')
!python run.py
!pip install dgl-cu113 dglgo -f https://data.dgl.ai/wheels/repo.html
!pip install keras==2.2.4
!pip install ogb==1.3.3















