I am trying to reproduce the entity embedding models using Keras. Here is the github link and use the kaggle
branch. There is one python file models.py
and the Merge
layer is used.
from keras.layers.core import Dense, Dropout, Activation, Merge, Reshape
......
self.model.add(Merge(models, mode='concat'))
This code should be fine for old-version of Keras, but using Keras 2.0.0 using tensorflow 1.0.0 as the backend (python 2.7), there will be wrong information:
Using TensorFlow backend.
Traceback (most recent call last):
File "/Users/pengjuzhao/Udacity/MLND/entity-embedding-rossmann/test_model.py", line 2, in <module>
from models import NN_with_EntityEmbedding
File "/Users/pengjuzhao/Udacity/MLND/entity-embedding-rossmann/models.py", line 8, in <module>
from keras.layers.core import Dense, Dropout, Activation, Merge, Reshape
ImportError: cannot import name Merge
[Finished in 1.8s with exit code 1]
[shell_cmd: python -u "/Users/pengjuzhao/Udacity/MLND/entity-embedding-rossmann/test_model.py"]
[dir: /Users/pengjuzhao/Udacity/MLND/entity-embedding-rossmann]
[path: /usr/bin:/bin:/usr/sbin:/sbin]
Is there anyone who knows how to reach the same target(self.model.add(Merge(models, mode='concat'))
)or how to use the merge/Merge layer using Keras 2.0.0 ?
Thank you in advance.