Repository: dmlc/dgl

Issue:
Error due to missing argument to specify dataset name in gcn example
## 🐛 Bug

In `gcn/train.py` it raises error due to `Unknown dataset`.

```ValueError: Unknown dataset: None```

## To Reproduce

Steps to reproduce the behavior:

1. Run `gcn/train.py` without arguments

<!-- If you have a code sample, error messages, stack traces, please provide it here as well -->

## Environment

 - DGL Version (e.g., 1.0): 0.7
 - Backend Library & Version (e.g., PyTorch 0.4.1, MXNet/Gluon 1.3): 1.9.0
 - OS (e.g., Linux): Windows 10
 - How you installed DGL (`conda`, `pip`, source): source
 - Build command you used (if compiling from source): same as the installation guide
 - Python version: 3.9.5

## Additional context

It is because this example didn't pass `dataset` to `parser.add_argument` but, in `main()`, `dataset` is required to specify which dataset is used.

I didn't run `gcn/train.py`  in MXNet, but I guess it raises the same error when using MXNet.



Discussion:

Resolving patch:
diff --git a/examples/mxnet/gcn/train.py b/examples/mxnet/gcn/train.py
--- a/examples/mxnet/gcn/train.py
+++ b/examples/mxnet/gcn/train.py
@@ -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
@@ -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,
diff --git a/examples/pytorch/gcn/train.py b/examples/pytorch/gcn/train.py
--- a/examples/pytorch/gcn/train.py
+++ b/examples/pytorch/gcn/train.py
@@ -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
@@ -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,
diff --git a/examples/tensorflow/gcn/train.py b/examples/tensorflow/gcn/train.py
--- a/examples/tensorflow/gcn/train.py
+++ b/examples/tensorflow/gcn/train.py
@@ -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
 
@@ -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,


Test patch: