richliao / textClassifier

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

problem with textClassifierHATT.py, thank you #6

Open ericalingyuan opened 7 years ago

ericalingyuan commented 7 years ago

Traceback (most recent call last): File "textClassifierHATT.py", line 203, in l_dense_sent = TimeDistributed(Dense(200,input_shape=(200,)))(l_lstm_sent) File "/usr/local/lib/python2.7/dist-packages/Keras-2.0.4-py2.7.egg/keras/engine/topology.py", line 569, in call self.assert_input_compatibility(inputs) File "/usr/local/lib/python2.7/dist-packages/Keras-2.0.4-py2.7.egg/keras/engine/topology.py", line 440, in assert_input_compatibility str(K.ndim(x))) ValueError: Input 0 is incompatible with layer time_distributed_4: expected ndim=3, found ndim=4

scpei commented 7 years ago

Hello, I have same error with you. Have you fixed it? Thanks

thomasnt13 commented 7 years ago

same error... plz help

mutiann commented 7 years ago

Try to use keras1.2.2 rather than keras2

maoyanying commented 7 years ago

I have the same erro. How did you deal with it??I will wait your answer.Thanks a lot !

ericalingyuan commented 7 years ago

Sorry, I still cannot solve this issue.

maoyanying commented 7 years ago

so ,did you find other code which can implementate the paper of Hierarchical Attention Networks for Document Classification?

ericalingyuan commented 7 years ago

check this code, https://github.com/thunlp/NSC. Based on their paper, I think NSC+LA is the same Hierarchical Attention Networks. That code works well.

maoyanying commented 7 years ago

Thank you.check this code,https://github.com/ematvey/deep-text-classifier,Based on the paper of Hierarchical Attention Networks for Document Classification,but have some problem.

maoyanying commented 7 years ago

https://github.com/ematvey/deep-text-classifier

ericalingyuan commented 7 years ago

Thanks a lot for sharing this with me :-)

On Wed, Jul 26, 2017 at 9:56 PM, maoyanying notifications@github.com wrote:

https://github.com/ematvey/deep-text-classifier

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/richliao/textClassifier/issues/6#issuecomment-318235933, or mute the thread https://github.com/notifications/unsubscribe-auth/AGtvdctDB2m_6VRRZ6p4QrWZ9KxpQ9C2ks5sR-5YgaJpZM4NYn3Q .

maoyanying commented 7 years ago

Did you run the work of https://github.com/ematvey/deep-text-classifier? @ericalingyuan

maoyanying commented 7 years ago

Did you try to use keras1.2.2 rather than keras2 in this work?

mutiann commented 7 years ago

(Simply use keras1.2. The problem is due to incompatibility.)

Mining-multiple-repos-data commented 7 years ago

I used Keras1.2 still getting the same error, can anyone please help with this?

Mining-multiple-repos-data commented 7 years ago

Hey!! Finally it works - with 1.2.2 version, but not 1.2

prernakhurana2 commented 7 years ago

How will it work with the latest keras version-2.0.2 ??

maoyanying commented 7 years ago

it may not work.

prernakhurana2 commented 7 years ago

It is throwing error at this line--- l_dense_sent = TimeDistributed(Dense(200))(l_lstm_sent) but not at this --- l_dense = TimeDistributed(Dense(200))(l_lstm)

If it is due to version, then should it not throw error at the above line as well

maoyanying commented 7 years ago

it works with1. 2.2version Keras.