can't import keras.layers.Merge

后端 未结 2 1077
慢半拍i
慢半拍i 2021-02-04 10:17

I want to merge two LSTM models in Keras. I have seen many examples of importing Merge as:

from keras.layers import Merge

When I do this, I get

相关标签:
2条回答
  • 2021-02-04 10:45

    Cause : case sensitive change it from keras.layers import Merge to from keras.layers import merge

    0 讨论(0)
  • 2021-02-04 10:52

    As of keras 2, the module keras.layers.merge doesn't have a generic public Merge-Layer. Instead you are supposed to import the subclasses like keras.layers.Add or keras.layers.Concatenate etc. directly (or their functional interfaces with the same names lowercase: keras.layers.add, keras.layers.concatenate etc.).

    See what types of merging layers exist in the keras docs

    0 讨论(0)
提交回复
热议问题