GINDataset is broken: dgl._ffi.base.DGLError: Expect argument "u" to have data type int32 or int64, but got torch.float32
- Dominant language
- Python
- Stars
- 14.3k
- Forks
- 3.1k
- PR merge metrics
- No merged PRs in 30d
Description
## 🐛 Bug
This example breaks.
## To Reproduce
```
[yuri@yv /usr/ports/math/py-dgl/work-py39/dgl-1.1.0/examples/pytorch/gin]$ python3.9 train.py --dataset MUTAG
Training with DGL built-in GINConv module with a fixed epsilon = 0
Traceback (most recent call last):
File "/usr/ports/math/py-dgl/work-py39/dgl-1.1.0/examples/pytorch/gin/train.py", line 147, in
dataset = GINDataset(
File "/usr/local/lib/python3.9/site-packages/dgl/data/gindt.py", line 132, in __init__
super(GINDataset, self).__init__(
File "/usr/local/lib/python3.9/site-packages/dgl/data/dgl_dataset.py", line 333, in __init__
super(DGLBuiltinDataset, self).__init__(
File "/usr/local/lib/python3.9/site-packages/dgl/data/dgl_dataset.py", line 112, in __init__
self._load()
File "/usr/local/lib/python3.9/site-packages/dgl/data/dgl_dataset.py", line 203, in _load
self.process()
File "/usr/local/lib/python3.9/site-packages/dgl/data/gindt.py", line 240, in process
g.add_edges(j, nrow[2:])
File "/usr/local/lib/python3.9/site-packages/dgl/heterograph.py", line 541, in add_edges
u = utils.prepare_tensor(self, u, "u")
File "/usr/local/lib/python3.9/site-packages/dgl/utils/checks.py", line 56, in prepare_tensor
raise DGLError(
dgl._ffi.base.DGLError: Expect argument "u" to have data type int32 or int64, but got torch.float32.
```
dgl.data.GINDataset is broken. The above error is reproducible with:
```
from dgl.data import GINDataset
dataset = GINDataset("MUTAG", self_loop=True, degree_as_nlabel=False)
```
## Environment
- DGL Version (e.g., 1.0):1.1.0
- Backend Library & Version (e.g., PyTorch 0.4.1, MXNet/Gluon 1.3): PyTorch-2.0.0
- OS (e.g., Linux): FreeBSD 13.2
- How you installed DGL (`conda`, `pip`, source): package
- Build command you used (if compiling from source): n/a
- Python version: 3.9
- CUDA/cuDNN version (if applicable): n/a
- GPU models and configuration (e.g. V100): n/a
- Any other relevant information: numpy-1.23.1
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.