Hi guys.
I’m new to DGL and following the graph classification topic (training loop section) I’m trying to iterate through the dataloader (GraphDataLoader) to train a GNN model, but I’m getting the following error:
DGLError: [15:08:45] /opt/dgl/src/graph/./heterograph.h:34: Check failed: etype < meta_graph_->NumEdges() (53 vs. 53) : Invalid edge type: 53
Stack trace:
[bt] (1) /usr/local/lib/python3.10/dist-packages/dgl/libdgl.so(dgl::HeteroGraph::GetRelationGraph(unsigned long) const+0x14e) [0x7a261097773e]
[bt] (2) /usr/local/lib/python3.10/dist-packages/dgl/libdgl.so(dgl::DisjointUnionHeteroGraph2(std::shared_ptr<dgl::GraphInterface>, std::vector<std::shared_ptr<dgl::BaseHeteroGraph>, std::allocator<std::shared_ptr<dgl::BaseHeteroGraph> > > const&)+0x2d6) [0x7a2610a60f96]
[bt] (3) /usr/local/lib/python3.10/dist-packages/dgl/libdgl.so(+0x7893ce) [0x7a26109893ce]
[bt] (4) /usr/local/lib/python3.10/dist-packages/dgl/libdgl.so(+0x789574) [0x7a2610989574]
[bt] (5) /usr/local/lib/python3.10/dist-packages/dgl/libdgl.so(DGLFuncCall+0x48) [0x7a261090e558]
[bt] (6) /usr/local/lib/python3.10/dist-packages/dgl/_ffi/_cy3/core.cpython-310-x86_64-linux-gnu.so(+0x1a2c6) [0x7a25fe01a2c6]
[bt] (7) /usr/local/lib/python3.10/dist-packages/dgl/_ffi/_cy3/core.cpython-310-x86_64-linux-gnu.so(+0x1ab1f) [0x7a25fe01ab1f]
[bt] (8) /usr/bin/python3(_PyObject_MakeTpCall+0x25b) [0x59a228e8ea7b]
The piece of code related to the error is:
dataloader = GraphDataLoader(
d_train,
batch_size=5,
drop_last=False,
shuffle=True)
12 for epoch in range(20):
--> 13 for batched_graph, labels in dataloader: # line getting error
14 logits = model(batched_graph)
15 loss = F.cross_entropy(logits, labels)
The data is composed by multiple heterographs (100 for training), with 1 node type, and 60 edge types. The batch_size=5.
Each graph represents some user’s activities such as downloading some software. The nodes of the graphs are system entities (hosts, processes, files) and the edges are Linux system calls.
Could someone indicate to me what might be triggering this error?
If any more information is required, I’m available Thanks in advance.