0

I have a program that it has been written for Keras 1.x.x and I am trying to rerun it in Keras 2.x.x. However when it reaches to this point,

from keras.layers import Input, merge

up2 = merge([UpSampling2D(size=(2, 2))(conv5), conv4], mode='concat', concat_axis=1)

it is showing the following error:

UserWarning: The `merge` function is deprecated and will be removed after 08/2017. Use instead layers from `keras.layers.merge`, e.g. `add`, `concatenate`, etc.
  up1 = merge([UpSampling2D(size=(2, 2))(conv3), conv2], mode='concat', concat_axis=1)
/usr/local/python/3.5.2-gcc4/externalmodules/lib/python3.5/site-packages/keras/legacy/layers.py:456: UserWarning: The `Merge` layer is deprecated and will be removed after 08/2017. Use instead layers from `keras.layers.merge`, e.g. `add`, `concatenate`, etc.
  name=name)

I have not changed anything, even data is same. Could you please guide me how can I convert the merge function to be readable on Keras 2.x.x.? Thank you

S.EB
  • 1,966
  • 4
  • 29
  • 54

1 Answers1

0

The warning is quit clear. You should use kears.layers.merge.Concatenate instead of merge.

from keras.layers.merge import Concatenate
up2 = Concatenate([UpSampling2D(size=(2, 2))(conv5), conv4], axis=1)
Wilmar van Ommeren
  • 7,469
  • 6
  • 34
  • 65
  • 1
    thanks for your comment. I tried your suggestion and it is showing me the following error: `TypeError: __init__() got multiple values for argument 'axis'` – S.EB May 16 '17 at 01:54