ACL2020SpellGCN / SpellGCN

SpellGCN
https://arxiv.org/abs/2004.14166
241 stars 63 forks source link

ValueError: Shape must be rank 2 but is rank 3 for 'gcn/GCN-0/relation_prototype_scope/MatMul' (op: 'MatMul') with input shapes: [2,4755,768], [768,1]. #22

Open hhhmmmzzz opened 3 years ago

hhhmmmzzz commented 3 years ago

我在跑模型的时候遇到了一个这样的错误: ValueError: Shape must be rank 2 but is rank 3 for 'gcn/GCN-0/relation_prototype_scope/MatMul' (op: 'MatMul') with input shapes: [2,4755,768], [768,1]. 不知道还有没有同学遇到了,求解答,非常非常感谢啦!

cxysteven commented 3 years ago

检查一下数据,能否贴多一点信息

hhhmmmzzz commented 3 years ago

我把tensorflow换成1.14.0之后就不报错啦,非常感谢!

okcd00 commented 2 years ago

对于 tensorflow 版本小于 1.14 的,可以试试修改 run_spellgcn.py 的 L308 报错位置:

if str(tf.__version__) < '1.14':
  # with tensorflow <1.14
  graph_weights = tf.tensordot(multi_graph_embs, w0, [[2], [0]]) / 3
  graph_weights = tf.nn.softmax(graph_weights, axis=0)
else:
  graph_weights = tf.matmul(multi_graph_embs, w0) / 3