Keras load pre-trained weights. Shape mismatch
I have solved the kind of issue as follows. Hope the solution would be helpful.
1. Delete &quot;by_name=True&quot;
# -model.load_weights(weights_path, by_name=True)
model.load_weights(weights_path)

2. Change the number of class
While it throws another throwing &quot;ValueError: Shapes (1536, 1000) and (1536, 1001) are incompatible&quot;, I change num_classes from 1000 to 1001. And then it shows the correct model summary.
# -num_classes = 1000
num_classes = 1001