Gowtham
Gowtham

Reputation: 11

ValueError: The layer sequential has never been called and thus has no defined output

   from tensorflow.keras.applications import EfficientNetV2B3
    base_model = EfficientNetV2B3(include_top=False, weights="imagenet", input_shape=(224, 224, 3))

    print(base_model.output)

    <KerasTensor shape=(None, 7, 7, 1536), dtype=float32, sparse=False, name=keras_tensor_411>



my_model = Sequential([
 layers.InputLayer(shape=(224, 224, 3)),
 layers.Rescaling(scale=1./127.5, offset=-1),
 base_model,        
 layers.GlobalAveragePooling2D(),

 layers.Dense(256, activation='relu'),
 layers.Dropout(0.4),

 layers.Dense(128, activation='relu'),
 layers.Dropout(0.4),

 layers.Dense(6, activation='softmax')
])

print(my_model.output)

ValueError: The layer sequential has never been called and thus has no defined output.

Upvotes: 1

Views: 167

Answers (0)

Related Questions