A toy custom-built dataset
Number of graphs: 1 Number of features: 9 Number of classes: 2
the graph has normalized values for the edge weights.
With simple GCN fails training when I call train(graph,model) like this:
graph = dgl.add_self_loop(graph) model = GCN(graph.ndata['feat'].shape, 16, dataset.num_classes)
The error is:
424 rst = graph.dstdata['h'] 425 if weight is not None: --> 426 rst = th.matmul(rst, weight) 427 428 if self._norm != 'none': RuntimeError: expected scalar type Double but found Float
Should I increase the size of my graph?
class GCN(nn.Module): def __init__(self, in_feats, h_feats, num_classes): super(GCN, self).__init__() self.conv1 = GraphConv(in_feats, h_feats) self.conv2 = GraphConv(h_feats, num_classes) def forward(self, g, in_feat): h = self.conv1(g, in_feat) h = F.relu(h) h = self.conv2(g, h) return h