Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Keras version (avoid bug from keras==2.1.5) #1963

Merged
merged 1 commit into from
Mar 8, 2018

Conversation

menshikh-iv
Copy link
Contributor

No description provided.

@menshikh-iv menshikh-iv merged commit bfb33ff into develop Mar 8, 2018
@menshikh-iv menshikh-iv deleted the menshikh-iv-patch-1-1 branch March 8, 2018 07:26
@piskvorky
Copy link
Owner

What bug? Can you add a link to the description?

@menshikh-iv
Copy link
Contributor Author

One of keras-integration test failed with Keras==2.1.5 and tensorflow==1.3.0

https://github.com/RaRe-Technologies/gensim/blob/a781b40c49a39b406bb10054ccadc86a3af84500/gensim/test/test_keras_integration.py#L47-L73

Traceback:

ERROR: testEmbeddingLayerCosineSim (__main__.TestKerasWord2VecWrapper)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "gensim/test/test_keras_integration.py", line 60, in testEmbeddingLayerCosineSim
    similarity = dot([embedding_a, embedding_b], axes=2, normalize=True)
  File "/home/ivan/.virtualenvs/qqq/local/lib/python2.7/site-packages/keras/layers/merge.py", line 660, in dot
    return Dot(axes=axes, normalize=normalize, **kwargs)(inputs)
  File "/home/ivan/.virtualenvs/qqq/local/lib/python2.7/site-packages/keras/engine/topology.py", line 619, in __call__
    output = self.call(inputs, **kwargs)
  File "/home/ivan/.virtualenvs/qqq/local/lib/python2.7/site-packages/keras/layers/merge.py", line 155, in call
    return self._merge_function(inputs)
  File "/home/ivan/.virtualenvs/qqq/local/lib/python2.7/site-packages/keras/layers/merge.py", line 484, in _merge_function
    x1 = K.l2_normalize(x1, axis=axes[0])
  File "/home/ivan/.virtualenvs/qqq/local/lib/python2.7/site-packages/keras/backend/tensorflow_backend.py", line 3151, in l2_normalize
    return tf.nn.l2_normalize(x, axis=axis)
TypeError: l2_normalize() got an unexpected keyword argument 'axis'

----------------------------------------------------------------------

To avoid this, I limited Keras version <= 2.1.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants