Keras: Unable two merge two image inputs - error : 'get_output_shape_at'

Created on 22 Apr 2016  路  6Comments  路  Source: keras-team/keras

Hi,

the following code does not compile:
part_A_input = Input(shape=(3,self.partSize,self.partSize), name='part_A_input') part_B_input = Input(shape=(3,self.partSize,self.partSize), name='part_B_input') concat_branch = Merge(layers=[crop_A, crop_B], mode='concat', concat_axis=1)

the error is :AttributeError: 'TensorVariable' object has no attribute 'get_output_shape_at'

while the old graph model works fine :
graph.add_node(Some-Function, name='concatenate', inputs=['part_A_input', 'part_B_input'], concat_axis=-1)

any idea?

thanks!

Most helpful comment

Merge is for layers, merge is for tensors. This is in the docs...

All 6 comments

Try

merge([part_A_input, part_B_input], mode='concat', concat_axis=1)

although in the second example you used concat_axis=-1

Merge is for layers, merge is for tensors. This is in the docs...

"This is in the docs" - is it? Looking at https://keras.io/layers/core/#merge , the docs say "A Merge layer can be used to merge a list of tensors into a single tensor" and "layers: Can be a list of Keras tensors or a list of layer instances."

Hi, I have the same question as @sliedes . I dont find a "merge" function in Keras. Can someone point me to the specific import?

It's in keras.layers, both merge and Merge.

Hi. Thank you.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

phipleg picture phipleg  路  60Comments

wx405557858 picture wx405557858  路  71Comments

zhuoqiang picture zhuoqiang  路  91Comments

xieximeng2008 picture xieximeng2008  路  74Comments

patyork picture patyork  路  73Comments