![]() ![]() data.x: Node feature matrix with shape Įdge_index = torch.tensor(, ], dtype=torch.long).Taken from the documentation: Data Handling of Graphs I just assume this is because you have only one feature at each node, and you most probably didn't reshape the data before passing it to the Dataset. It looks like the OurDataset you created doesn't fit the assumptions of the graph dataset. TLDR: reshape your data-points to => before constructing the dataset. Inde圎rror: Dimension out of range (expected to be in range of, but got -2) > 161 edge_index, edge_weight, x.size(self.node_dim), ~/anaconda3/lib/python3.8/site-packages/torch_geometric/nn/conv/gcn_conv.py in forward(self, x, edge_index, edge_weight)ġ60 edge_index, edge_weight = gcn_norm( # yapf: disable > 727 result = self.forward(*input, **kwargs) ![]() ~/anaconda3/lib/python3.8/site-packages/torch/nn/modules/module.py in _call_impl(self, *input, **kwargs)ħ25 result = self._slow_forward(*input, **kwargs) > 38 z = self.encoder(node_feature, edge_lst) Inde圎rror Traceback (most recent call last)ģ7 def encode(self, node_feature, edge_lst): Loss_ep += loss.cpu().detach().data.numpy() Loss = criterion(x.reshape(-1), predicted_x) Optimizer = (model.parameters(), lr=1e-3) Model = OurGAE(num_features, out_channels, node)ĭevice = vice('cuda' if _available() else 'cpu') Self.linear = nn.Linear(out_channels, len(node))ĭef encode(self, node_feature, edge_lst):ĭataset = OurDataset(one_node_feature, super_edge_lst) Self.encoder = GCNEncoder(num_features, out_channels) nv2 = GCNConv(out_channels, out_channels, cached=True)ĭef _init_(self, num_features, out_chennels, node): nv1 = GCNConv(in_channels, out_channels, cached=True) I cannot understand why self.node_dim is included in the size function, shown in the error code.ĭata.x is node_feature in which the number of features for each node is just one, and the number of nodes is 2058.ĭef _init_(self, in_channels, out_channels): I have some trouble with Inde圎rror in my GCN code. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |