shyamupa / snli-entailment

attention model for entailment on SNLI corpus implemented in Tensorflow and Keras
178 stars 43 forks source link

encounter an error #4

Closed zhihuizheng closed 7 years ago

zhihuizheng commented 7 years ago

Why did I encounter such an error?

  r = Reshape((k, ), name="r")(r_)
  File "/usr/local/lib/python2.7/site-packages/Keras-1.0.3-py2.7.egg/keras/engine/topology.py", line 485, in __call__
    self.add_inbound_node(inbound_layers, node_indices, tensor_indices)
  File "/usr/local/lib/python2.7/site-packages/Keras-1.0.3-py2.7.egg/keras/engine/topology.py", line 543, in add_inbound_node
    Node.create_node(self, inbound_layers, node_indices, tensor_indices)
  File "/usr/local/lib/python2.7/site-packages/Keras-1.0.3-py2.7.egg/keras/engine/topology.py", line 151, in create_node
    output_shapes = to_list(outbound_layer.get_output_shape_for(input_shapes[0]))
  File "/usr/local/lib/python2.7/site-packages/Keras-1.0.3-py2.7.egg/keras/layers/core.py", line 206, in get_output_shape_for
    return (input_shape[0],) + self._fix_unknown_dimension(input_shape[1:], self.target_shape)
  File "/usr/local/lib/python2.7/site-packages/Keras-1.0.3-py2.7.egg/keras/layers/core.py", line 201, in _fix_unknown_dimension
    raise ValueError(msg)
ValueError: total size of new array must be unchanged
shyamupa commented 7 years ago

Seems to be a keras version problem. Did you try with keras 1.0.6?

zhihuizheng commented 7 years ago

It works under keras 1.0.6, thank you.