Keras layer gives error

I’m working on the Neural_machine_translation_with_attention_v4a notebook on UNQ_C1
and I have run the first layer on s_prev according to the instructions and i get the following shapes for a and s_prev:
(10, 30, 64)
(10, 30, 64)
but when I run the next layer using concatenator(a,s_prev) I get the following error:
ValueError: A Concatenate layer should be called on a list of at least 2 inputs
I do not understand why this error occurs as I am using two inputs: a and s_prev

To use concatenator(), which is an instantiation of tf.keras.layers.Concatenate(), you need to pass the list. Here is an example.

concatted = tf.keras.layers.Concatenate()([x1, x2])

Note that " tf.keras.layers.Concatenate()" is already instantiated. So, you just need to focus on parameters at the last. :slight_smile:

Hope this helps.

1 Like