Issue
fusion_model = tf.keras.layers.concatenate([m1.output, m2.output])
m1 and m2 are Model objects.
I'm concatenating the outputs of the two models and I'm getting the following error:
AttributeError: 'Sequential' object has no attribute '_nested_outputs'
This exact code used to work in TF 1.14. Any help? thanks
After experimenting with this example, it appears to crash on the statement m2.output
(m1.output
runs fine)
my M2 model is:
Layer (type) Output Shape Param #
=================================================================
rescaling_1 (Rescaling) (None, 456, 456, 3) 0
_________________________________________________________________
efficientnetb5 (Functional) (None, 15, 15, 2048) 28513527
_________________________________________________________________
global_average_pooling2d (Gl (None, 2048) 0
_________________________________________________________________
dense_3 (Dense) (None, 160) 327840
_________________________________________________________________
dropout_19 (Dropout) (None, 160) 0
_________________________________________________________________
predictions (Dense) (None, 19) 3059
Solution
You need to build()
the model with the appropriate input_shape parameter. This is what's causing this issue.
Answered By - Christo S. Christov
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.