-3

im trying siamese neural network with this site. but i got error like this...

enter image description here

i've tried to call con_model but it still give error i dont know much about siamese or keras or neural network. im just trying and learn. any body can help me to solve this code?

Itha LItha
  • 19
  • 4

1 Answers1

1

Instead of that merge, which is probably not imported from the correct place, and is probably not recommended anymore, you can use a Lambda layer.

merged_model = keras.layers.Lambda(l1_distance)([model_output_left, model_output_right])

If you're using Tensorflow, the Lambda layers will not require an output shape. If you want an output shape for some reason, you need keras.backend.int_shape(x[0]). The value x[0] alone is not a shape!

Daniel Möller
  • 84,878
  • 18
  • 192
  • 214