I would like to count the number of parameters of a Object Detection model loaded from TensorFlow Hub, for example https://tfhub.dev/tensorflow/ssd_mobilenet_v2/2. I've tried this:
hub_model = hub.load("https://tfhub.dev/tensorflow/ssd_mobilenet_v2/2")
print(len(hub_model.signatures['serving_default'].variables))
But the output is not very readable and I'm not even sure if it's correct. I've also tried this way:
malli = hub.KerasLayer("https://tfhub.dev/tensorflow/ssd_mobilenet_v2/2")
print("Thickness of the model:", len(malli.weights))
But it returns just an empty list [] of length 0.
It would be nice to be able to use the Keras summary() method on these models, but it cannot be called on a KerasLayer, so would incorporating this layer into a model with Keras.Sequential work?