ValueError: No model found in the config file.
As explained here this is because the
.h5 file contains only weights, not a model.
.h5 files are only weights. What's the purpose of having only weights without architecture?
I was trying to do following code:
resnet18_path_to_file = "models/resnet18.h5" resnet18 = tf.keras.models.load_model(resnet18_path_to_file) resnet18.compile() inputs = resnet18.input outputs = resnet18.layers[-2].output return tf.keras.models.Model(inputs=inputs, outputs=outputs, name="custom_resnet18")