gnnkeras:concatop:输入的维度应该匹配

ovfsdjhp  于 2021-09-08  发布在  Java
关注(0)|答案(0)|浏览(302)

在测试示例化和调用gnn模型的过程中应用gnnnodeclassifier的第一个graph conv层时,我得到了以下错误(其他类似concatop的错误是:输入的维度应该匹配)。但在我的例子中,我使用的是一个图形神经网络。
错误: InvalidArgumentError: ConcatOp : Dimensions of inputs should match: shape[0] = [1405,12] vs. shape[1] = [1401,12] [Op:ConcatV2] name: concat 这些图有1405个节点,但我注意到 class GraphConvLayer(layers.Layer): 我得到了一个不匹配的昏暗的 aggregated_messages .
当它使用 neighbour messages ,我们有以下形状: (1405, 12) (1401, 12) .
最后,我注意到在graphconvlayer中:节点数量减少到1401个。这是如何发生的?我该怎么办?

def aggregate(self, node_indices, neighbour_messages):
        # node_indices shape is [num_edges].
        # neighbour_messages shape: [num_edges, representation_dim].
        num_nodes = tf.math.reduce_max(node_indices) + 1
``` `num_nodes` 结果是: `tf.Tensor(1401, shape=(), dtype=int64)` 问题:我需要比节点有更多的边吗?目前我有1k个边对,有1405个不同的节点?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题