Skip to content

Cannot load weight of pre-trained models #21529

@h3dema

Description

@h3dema

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.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions