CRIPAC-DIG / TextING

[ACL 2020] Tensorflow implementation for "Every Document Owns Its Structure: Inductive Text Classification via Graph Neural Networks"
180 stars 57 forks source link

请问TING的代码中将model设为dense后为什么跑不通?而TGCN的dense可以跑通。 #4

Closed kouhuitong closed 4 years ago

kouhuitong commented 4 years ago

请问TING的代码中将model设为dense后为什么跑不通?而TGCN的dense可以跑通。 File "E:/新论文/TextING-master/train.py", line 87, in model = model_func(placeholders, input_dim=FLAGS.input_dim, logging=True) File "E:\新论文\TextING-master\models.py", line 103, in init self.build() File "E:\新论文\TextING-master\models.py", line 48, in build hidden = layer(self.activations[-1]) File "E:\新论文\TextING-master\layers.py", line 113, in call outputs = self._call(inputs) File "E:\新论文\TextING-master\layers.py", line 157, in _call x = sparse_dropout(x, 1-self.dropout, self.num_features_nonzero) File "E:\新论文\TextING-master\layers.py", line 26, in sparse_dropout pre_out = tf.sparse_retain(x, dropout_mask) File "E:\anaconda\lib\site-packages\tensorflow_core\python\ops\sparse_ops.py", line 1749, in sparse_retain sp_input = _convert_to_sparse_tensor(sp_input) File "E:\anaconda\lib\site-packages\tensorflow_core\python\ops\sparse_ops.py", line 69, in _convert_to_sparse_tensor raise TypeError("Input must be a SparseTensor.") TypeError: Input must be a SparseTensor.

Magicat128 commented 4 years ago

@kouhuitong 您好,因为相比Text GCN增加了一个维度,dense使用的是GCN的源码。已更新相关部分代码,请检查最新版。