W3 A1 summary adds unwanted "RepeatVector" Layers, grader sais failed

When building up the model, there are appearing 9 repeatvector layers, which seem not to disturb the model, but the grader claims an incorrect model summary.

My model summary looks as follows:

[[‘InputLayer’, [(None, 30, 37)], 0], [‘InputLayer’, [(None, 64)], 0], [‘Bidirectional’, (None, 30, 64), 17920], [‘RepeatVector’, (None, 30, 64), 0, 30], [‘Concatenate’, (None, 30, 128), 0], [‘Dense’, (None, 30, 10), 1290, ‘tanh’], [‘Dense’, (None, 30, 1), 11, ‘relu’], [‘Activation’, (None, 30, 1), 0], [‘Dot’, (None, 1, 64), 0], [‘InputLayer’, [(None, 64)], 0], [‘LSTM’, [(None, 64), (None, 64), (None, 64)], 33024, [(None, 1, 64), (None, 64), (None, 64)], ‘tanh’], [‘RepeatVector’, (None, 30, 64), 0, 30], [‘RepeatVector’, (None, 30, 64), 0, 30], [‘RepeatVector’, (None, 30, 64), 0, 30], [‘RepeatVector’, (None, 30, 64), 0, 30], [‘RepeatVector’, (None, 30, 64), 0, 30], [‘RepeatVector’, (None, 30, 64), 0, 30], [‘RepeatVector’, (None, 30, 64), 0, 30], [‘RepeatVector’, (None, 30, 64), 0, 30], [‘RepeatVector’, (None, 30, 64), 0, 30], [‘Dense’, (None, 11), 715, ‘softmax’]

when I continue ignoring the summary difference, it can train and fits as expected. I have no idea, where these repeatvector layers are created. Can you give me a hint ?

Regards,
Andreas

Hi @And77

It might be due to a loop or copy of the layer being used multiple times without realizing it. Check where RepeatVector is defined in your model and ensure it’s not being added repeatedly by mistake. Also, make sure you’re not calling the model layers within a loop or by reusing the same variable for different parts of the architecture.

Hope it helps! Feel free to ask if you need further assistance.

1 Like

Right, the only place RepeatVector should be referenced is in the one_step_attention function and that one instance does appear in the right place in your summary output. But then something goes off the rails in the “post activation LSTM” step. Are you sure you are invoking that function correctly? They “instantiate” it for you, so you have to be careful to use that version and not the “precursor” function used to do that instantiation. You also have to connect the inputs and outputs correctly, of course.