take x as slice of X, I tried both with the notaton I’d use in numpy and with some lambda slicing, both considering X as 3 and 2-dimensional (x = X[:,t,:] and x = X[t,:]), since maybe the “batch” axis doesn’t need to be considered

then finally try to reshape x simply by x = reshaper(x)

The model is compiled without errors with
model = djmodel(Tx=30, LSTM_cell=LSTM_cell, densor=densor, reshaper=reshaper)

but then when the following line is called
output = summary(model)

I get the error:

AttributeError Traceback (most recent call last)
in
2
3 # UNIT TEST
----> 4 output = summary(model)
5 comparator(output, djmodel_out)

~/work/W1A3/test_utils.py in summary(model)
34 result =
35 for layer in model.layers:
—> 36 descriptors = [layer.class.name, layer.output_shape, layer.count_params()]
37 if (type(layer) == Conv2D):
38 descriptors.append(layer.padding)

/opt/conda/lib/python3.7/site-packages/tensorflow/python/keras/engine/base_layer.py in output_shape(self)
2190 'ill-defined for the layer. ’
2191 'Use get_output_shape_at(node_index) ’
→ 2192 ‘instead.’ % self.name)
2193
2194 @property

AttributeError: The layer “reshape” has multiple inbound nodes, with different output shapes. Hence the notion of “output shape” is ill-defined for the layer. Use get_output_shape_at(node_index) instead.

I spent literally hours on the problem, but couldn’t find the solution. I beg for help.

Thank you for your answer. I meant that I had tried every sensible combination I could think of (included x = X[:,t,:]), but the error remained, and it was indeed due to the fact that TMosh mentioned.