Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImportError: No module named 'keras.layers.merge'

I am trying to import concatenate from keras.layers.merge but getting this error.

I have downgraded keras to 1.1.2. But still facing same error.

The line of code which gives error is:

from keras.layers.merge import concatenate

Also, I can't import Concatenate from keras models against code:

from keras.models import Concatenate
like image 805
OSAMA SADIQ Avatar asked Jul 30 '19 05:07

OSAMA SADIQ


2 Answers

As @Ivan mentioned, you can use either:

from keras.layers import concatenate

or

from tensorflow.keras.layers import concatenate
like image 159
Scott Avatar answered Nov 07 '22 17:11

Scott


do

from keras.layers import Concatenate
like image 44
meowongac Avatar answered Nov 07 '22 16:11

meowongac