Skip to content

Commit

Permalink
[Example] Fix error in gcn train due to missing argument (dmlc#3040)
Browse files Browse the repository at this point in the history
* Fix example

* Remove register_data_args and revert  to dataset

Co-authored-by: Minjie Wang <[email protected]>
  • Loading branch information
europeanplaice and jermainewang authored Jun 23, 2021
1 parent 5961c14 commit cb2327d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
5 changes: 2 additions & 3 deletions examples/mxnet/gcn/train.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
"""Training GCN model on citation graphs."""
import argparse, time
import numpy as np
import networkx as nx
import mxnet as mx
from mxnet import gluon

import dgl
from dgl.data import register_data_args
from dgl.data import CoraGraphDataset, CiteseerGraphDataset, PubmedGraphDataset

from gcn import GCN
Expand Down Expand Up @@ -112,7 +110,8 @@ def main(args):

if __name__ == '__main__':
parser = argparse.ArgumentParser(description='GCN')
register_data_args(parser)
parser.add_argument("--dataset", type=str, default="cora",
help="Dataset name ('cora', 'citeseer', 'pubmed').")
parser.add_argument("--dropout", type=float, default=0.5,
help="dropout probability")
parser.add_argument("--gpu", type=int, default=-1,
Expand Down
6 changes: 2 additions & 4 deletions examples/pytorch/gcn/train.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import argparse
import time
import numpy as np
import networkx as nx
import torch
import torch.nn as nn
import torch.nn.functional as F
import dgl
from dgl.data import register_data_args
from dgl.data import CoraGraphDataset, CiteseerGraphDataset, PubmedGraphDataset

from gcn import GCN
Expand Down Expand Up @@ -123,7 +120,8 @@ def main(args):

if __name__ == '__main__':
parser = argparse.ArgumentParser(description='GCN')
register_data_args(parser)
parser.add_argument("--dataset", type=str, default="cora",
help="Dataset name ('cora', 'citeseer', 'pubmed').")
parser.add_argument("--dropout", type=float, default=0.5,
help="dropout probability")
parser.add_argument("--gpu", type=int, default=-1,
Expand Down
5 changes: 2 additions & 3 deletions examples/tensorflow/gcn/train.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import argparse
import time
import numpy as np
import networkx as nx
import tensorflow as tf
import dgl
from dgl.data import register_data_args
from dgl.data import CoraGraphDataset, CiteseerGraphDataset, PubmedGraphDataset
from gcn import GCN

Expand Down Expand Up @@ -116,7 +114,8 @@ def main(args):

if __name__ == '__main__':
parser = argparse.ArgumentParser(description='GCN')
register_data_args(parser)
parser.add_argument("--dataset", type=str, default="cora",
help="Dataset name ('cora', 'citeseer', 'pubmed').")
parser.add_argument("--dropout", type=float, default=0.5,
help="dropout probability")
parser.add_argument("--gpu", type=int, default=-1,
Expand Down

0 comments on commit cb2327d

Please sign in to comment.