Explore Courses Blog Tutorials Interview Questions
0 votes
in Machine Learning by (19k points)

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.

1 Answer

0 votes
by (33.1k points)

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!

Browse Categories