1

Working on building a multi-input neural network based on tutorial here. When trying to combine input layers with the following code:

x1 = # layer 1
x2 = # layer 2
combined = tf.keras.layers.concatenate([x1.output,x2.output])

I get an error saying that the layers do not have an attribute output. Any ideas what I should try to merge these outputs to connect to the rest of my network?

1 Answer 1

3

Resolved pretty quickly, but will answer for anyone else that gets stuck. Remember to put your layers into a model before concatenating or else you'll get the AttributeError. My code now looks like

in1 = Input()
x1 = #layer
m1 = Model(inputs = in1, outputs = x1)

# same for in2,x2,m2

combined = tf.keras.layers.concatenate([m1,m2])

From there I was able to connect it to the rest of my network without issue.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.