WARNING:tensorflow:Model was constructed with shape (287, 512, 3) – help

I’m working through a toy problem to learn feature extraction with transfer learning. I gotten this warning when trying to compile this code. I’m running this on Google Colab, Tensorflow version 2.7. Is there something I can do to the input tensor on the base model to resolve this warning? Thanks.

input_shape = (224, 224, 3) base_model = tf.keras.applications.EfficientNetB0(include_top=False) base_model.trainable = False # Create input layer inputs = layers.Input(shape=input_shape, name="input_layer") # Add in data augmentation Sequential model as a layer x = data_augmentation(inputs) # Give base_model inputs (after augmentation) and don't train it x = base_model(x, training=False) # Pool output features of base model x = layers.GlobalAveragePooling2D(name="global_average_pooling_layer")(x) # Put a dense layer on as the output outputs = layers.Dense(10, activation="softmax", name="output_layer")(x) # Make a model with inputs and outputs model_1 = keras.Model(inputs, outputs) # Compile the model model_1.compile(loss="categorical_crossentropy", optimizer=tf.keras.optimizers.Adam(), metrics=["accuracy"]) # Fit the model history_1_percent =, epochs=5, steps_per_epoch=len(train_data_1_percent), validation_data=test_data_10_percent, # this is deliberate. validation_steps=int(0.25* len(test_data_10_percent)), # Track model training logs callbacks=[create_tensorboard_callback("transfer_learning_part_2", "1_percent_data_aug")]) 

submitted by /u/Pvt_Twinkietoes
[visit reddit] [comments]

Leave a Reply

Your email address will not be published. Required fields are marked *