brightmart / text_classification

all kinds of text classification models and more with deep learning
MIT License
7.87k stars 2.57k forks source link

TextRCNN 模型报错,维度不一致。 #109

Open rucJuanLi opened 5 years ago

rucJuanLi commented 5 years ago

output_conv=self.conv_layer_with_recurrent_structure() #shape:[None,sentence_length,embed_size*3] File "/home/juan_li/work_bishe/text_classification-master/text_classification-master/a04_TextRCNN/p71_TextRCNN_model_hg.py", line 122, in conv_layer_with_recurrent_structure representation=tf.concat([context_left_list[index],current_embedding_word,context_right_list[index]],axis=1) File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/ops/array_ops.py", line 1099, in concat return gen_array_ops._concat_v2(values=values, axis=axis, name=name) File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/ops/gen_array_ops.py", line 706, in _concat_v2 "ConcatV2", values=values, axis=axis, name=name) File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper op_def=op_def) File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/framework/ops.py", line 2956, in create_op op_def=op_def) File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/framework/ops.py", line 1470, in init self._traceback = self._graph._extract_stack() # pylint: disable=protected-access

InvalidArgumentError (see above for traceback): ConcatOp : Dimensions of inputs should match: shape[0] = [64,100] vs. shape[1] = [1,100] [[Node: concat = ConcatV2[N=3, T=DT_FLOAT, Tidx=DT_INT32, _device="/job:localhost/replica:0/task:0/device:CPU:0"](Tanh, Squeeze, Tanh_300, concat/axis)]]

TextRCNN 报错。

xuehui0725 commented 5 years ago

请问这个问题你解决了吗?我也碰到了 @rucJuanLi

TingNLP commented 5 years ago

I have a same error... Is there a solution?