richliao / textClassifier

Text classifier for Hierarchical Attention Networks for Document Classification
Apache License 2.0
1.07k stars 379 forks source link

the run problem in textClassifierHATT #35

Closed lvglvg closed 5 years ago

lvglvg commented 5 years ago

Hi, when I run the textClassifierHATT.py ,there shows a Dimensions problem show as blow: l_att_sent = AttLayer(100)(l_lstm_sent) Traceback (most recent call last):

File "", line 1, in l_att_sent = AttLayer(100)(l_lstm_sent)

File "C:\Users\GangLyu\Anaconda3\lib\site-packages\keras\engine\base_layer.py", line 457, in call output = self.call(inputs, **kwargs)

File "", line 31, in call ait *= K.cast(mask, K.floatx())

File "C:\Users\GangLyu\Anaconda3\lib\site-packages\tensorflow\python\ops\math_ops.py", line 862, in binary_op_wrapper return func(x, y, name=name)

File "C:\Users\GangLyu\Anaconda3\lib\site-packages\tensorflow\python\ops\math_ops.py", line 1129, in _mul_dispatch return gen_math_ops.mul(x, y, name=name)

File "C:\Users\GangLyu\Anaconda3\lib\site-packages\tensorflow\python\ops\gen_math_ops.py", line 5357, in mul "Mul", x=x, y=y, name=name)

File "C:\Users\GangLyu\Anaconda3\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 787, in _apply_op_helper op_def=op_def)

File "C:\Users\GangLyu\Anaconda3\lib\site-packages\tensorflow\python\util\deprecation.py", line 488, in new_func return func(*args, **kwargs)

File "C:\Users\GangLyu\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 3272, in create_op op_def=op_def)

File "C:\Users\GangLyu\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 1790, in init control_input_ops)

File "C:\Users\GangLyu\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 1629, in _create_c_op raise ValueError(str(e))

ValueError: Dimensions must be equal, but are 15 and 100 for 'att_layer_12/mul' (op: 'Mul') with input shapes: [?,15], [?,15,100].