I am trying to reproduce object injection models using Keras. Here is the github link and use the branch kaggle
. There is one python file models.py
and a layer is used Merge
.
from keras.layers.core import Dense, Dropout, Activation, Merge, Reshape
......
self.model.add(Merge(models, mode='concat'))
This code should be good for the old version of Keras, but using Keras 2.0.0, using shadoworflow 1.0.0 as the backend (python 2.7), there will be incorrect 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 achieve the same goal ( self.model.add(Merge(models, mode='concat'))
) or how to use the merge / merge level with Keras 2.0.0? Thanks in advance.
source
share