Back
Is there a way to get the number of layers (not parameters) in a Keras model?
model.summary() is very informative, but it is not straightforward to get the number of layers from it.
In Keras, you can use the model. layers, this will give you the list of all layers. The number is consequently lens(model.layers).
For more details on this, check out the Machine Learning Online Course given by the specialist present in Intellipaat.
Also, studying Machine Learning Tutorial will give one a pretty decent insight on Kernel as well.
Hope this answer helps you!
31k questions
32.8k answers
501 comments
693 users