Edge weigh error


Hello all,

I am currently working with a heterogeneous graph, with which I want to predict links between nodes. However when I try to train it I get the error in the image. I don’t know what error I have, apparently everything looks fine, I am using the function: “”"
It generates embeddings for a given graph applying all the instantiated layers in the previous function.
Input:
data: Graph.
Output:
Node embeddings.
“”"

def getEmbeddings(self, data):
    x = data.node_feature
    edge_index = data.edge_index
    edge_weight = data.edge_feature  # Edge weights need to be reformated to match model's requirements

    print('edge features keys imprimiendo')
    print(edge_weight)
    #print(edge_index)
    keys = [key for key in edge_weight]
    #print(keys)
    edge_weight2 = {}
    for key in keys: 
       
       newKey = key[1]
       edge_weight2[newKey] = edge_weight[key]
       print('EG2')
    print('x: '+str(x))
    print('edge_index: '+str(edge_index))
    print('edge_weight2: '+str(edge_weight2))
    x = self.convs1(x, edge_index, edge_weight2)
    x = forward_op(x, self.bns1)
    x = forward_op(x, self.relus1)

    x = forward_op(x, self.dropout1)
    #x = self.convs2(x, edge_index, edge_weight2)
    x = self.convs2(x, edge_index,edge_weight2)
    x = forward_op(x, self.bns2)

    return x

Are you using DGL for message passing? The callstack in the snapshot is not clear. please share more details.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.