textClassifier icon indicating copy to clipboard operation
textClassifier copied to clipboard

problem with textClassifierHATT.py, thank you

Open ericalingyuan opened this issue 8 years ago • 19 comments

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

ericalingyuan avatar May 11 '17 22:05 ericalingyuan

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

scpei avatar Jun 19 '17 21:06 scpei

same error... plz help

thomasnt13 avatar Jul 02 '17 04:07 thomasnt13

Try to use keras1.2.2 rather than keras2

mutiann avatar Jul 13 '17 03:07 mutiann

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

myy000123 avatar Jul 27 '17 01:07 myy000123

Sorry, I still cannot solve this issue.

ericalingyuan avatar Jul 27 '17 01:07 ericalingyuan

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

myy000123 avatar Jul 27 '17 01:07 myy000123

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.

ericalingyuan avatar Jul 27 '17 01:07 ericalingyuan

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.

myy000123 avatar Jul 27 '17 01:07 myy000123

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

myy000123 avatar Jul 27 '17 01:07 myy000123

Thanks a lot for sharing this with me :-)

On Wed, Jul 26, 2017 at 9:56 PM, maoyanying [email protected] 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 .

ericalingyuan avatar Jul 27 '17 01:07 ericalingyuan

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

myy000123 avatar Jul 27 '17 05:07 myy000123

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

myy000123 avatar Jul 27 '17 14:07 myy000123

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

mutiann avatar Jul 28 '17 05:07 mutiann

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

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

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

prernakhurana2 avatar Aug 23 '17 09:08 prernakhurana2

it may not work.

myy000123 avatar Aug 23 '17 09:08 myy000123

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

prernakhurana2 avatar Aug 23 '17 09:08 prernakhurana2

it works with1. 2.2version Keras.

myy000123 avatar Aug 23 '17 09:08 myy000123