Training is fine. however I got a error after training, I don't know how to solve it. Anyone could share me a hand?
Epoch 10/10
21054/21054 [==============================] - 257s - loss: 0.3286 - acc: 0.8863 - val_loss: 0.3596 - val_acc: 0.8643
Traceback (most recent call last):
File "Hatt_modify.py", line 231, in
l_dense_sent = TimeDistributed(Dense(200))(l_lstm_sent)
File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 586, in call
self.assert_input_compatibility(inputs)
File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 457, in assert_input_compatibility
str(K.ndim(x)))
ValueError: Input 0 is incompatible with layer time_distributed_4: expected ndim=3, found ndim=4
I have solved it. The reason why the error occurs was that the program should run in Keras 1.X instead of keras 2.x. If you encounter the similar problems, you can refer to it.
Training is fine. however I got a error after training, I don't know how to solve it. Anyone could share me a hand? Epoch 10/10 21054/21054 [==============================] - 257s - loss: 0.3286 - acc: 0.8863 - val_loss: 0.3596 - val_acc: 0.8643
Traceback (most recent call last): File "Hatt_modify.py", line 231, in
l_dense_sent = TimeDistributed(Dense(200))(l_lstm_sent)
File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 586, in call
self.assert_input_compatibility(inputs)
File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 457, in assert_input_compatibility
str(K.ndim(x)))
ValueError: Input 0 is incompatible with layer time_distributed_4: expected ndim=3, found ndim=4