Where to get models with weights instead of only weights? What's the purpose of .h5 files?
I have downloaded .h5
files from qubvel/resnet and qubvel/efficientnet. I was trying to use some models as a backbone for my model but I'm getting the following error:
ValueError: No model found in the config file.
As explained here this is because the .h5
file contains only weights, not a model.
So those .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)
Topic pretraining keras tensorflow
Category Data Science