I tried with tensorflow versions 2.19 and 2.18. The code that reproduces the error is:

import tensorflow as tf print(tf.__version__)

model = tf.keras.applications.EfficientNetB7( weights='imagenet', include_top=False, input_shape=(600, 600, 3) ) model.summary()

It raises "ValueError: Shape mismatch in layer #1 (named stem_conv)for weight stem_conv/kernel. Weight expects shape (3, 3, 1, 64). Received saved weight with shape (3, 3, 3, 64)". I tried clean the cache folder to get a fresher download, but the new download also raises the same error. Using include_top=True without input_shape parameter, also raises the same problem. Other model, e.g., EfficientNetB6, raises the same error.

Comment From: dhantule

Hi @h3dema, thanks for reporting this.

I've tested your code with the latest Keras 3.11.0 and Im facing the same error

ValueError: Shape mismatch in layer #1 (named stem_conv)for weight stem_conv/kernel. Weight expects shape (3, 3, 1, 64). Received saved weight with shape (3, 3, 3, 64)

However with Keras 3.8.0 everything seems to be working fine, please refer this attached gist. We'll look into this and update you.

Comment From: shubham-ojha-weheal

I have the same issue but with the B0 model. It says ValueError: Shape mismatch in layer #1 (named stem_conv)for weight stem_conv/kernel. Weight expects shape (3, 3, 1, 32). Received saved weight with shape (3, 3, 3, 32)

I installed TensorFlow version 2.18.1. It installed Keras version 3.11.1 Downgrading the Keras version to 3.8.0 solved the issue for me.