cbaziotis / datastories-semeval2017-task4

Deep-learning model presented in "DataStories at SemEval-2017 Task 4: Deep LSTM with Attention for Message-level and Topic-based Sentiment Analysis".
MIT License
196 stars 63 forks source link

Problem with "tensorflow_backend" #2

Closed Aminolroaya closed 7 years ago

Aminolroaya commented 7 years ago

I get the below massage when I try to run model_message.py for subtask A;

Traceback

(most recent call last):

File "/Users/datastories-semeval2017-task4-master/models/neural/model_message.py", line 90, in dropout_rnn_U=0.3) File "/Users/datastories-semeval2017-task4-master/models/neural/keras_models.py", line 104, in build_attention_RNN model.add(Attention()) File "/usr/local/lib/python3.6/site-packages/keras/models.py", line 332, in add output_tensor = layer(self.outputs[0]) File "/usr/local/lib/python3.6/site-packages/keras/engine/topology.py", line 572, in call self.add_inbound_node(inbound_layers, node_indices, tensor_indices) File "/usr/local/lib/python3.6/site-packages/keras/engine/topology.py", line 635, in add_inbound_node Node.create_node(self, inbound_layers, node_indices, tensor_indices) File "/usr/local/lib/python3.6/site-packages/keras/engine/topology.py", line 166, in create_node output_tensors = to_list(outbound_layer.call(input_tensors[0], mask=input_masks[0])) File "/usr/local/lib/python3.6/site-packages/kutilities/layers.py", line 94, in call eij = K.dot(x, self.W) File "/usr/local/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 819, in dot y_permute_dim = [y_permute_dim.pop(-2)] + y_permute_dim IndexError: pop index out of range

I wonder if you help me with this problem!

cbaziotis commented 7 years ago

The issue has to do with K.dot and Tensorflow backend. I pushed a fix. Run:

pip install keras-utilities -U

Let me know if this fixes the issue.

Lastly, i want to note that the project was developed using Theano as a backend and i suggest that you switch to Theano, as it has better RNN performance.

Aminolroaya commented 7 years ago

pip install keras-utilities -U solved the problem thanks.