Skip to content

cannot find keras.model.layers definition anywhere on the keras doc #21240

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
habib-source opened this issue May 2, 2025 · 5 comments
Closed
Assignees
Labels
type:support User is asking for help / asking an implementation question. Stackoverflow would be better suited.

Comments

@habib-source
Copy link

i cannot find the layers method used in this guide on the keras model class refrence

vgg19 = keras.applications.VGG19()
features_list = [layer.output for layer in vgg19.layers]

vgg19.layers?

@dhantule dhantule added the type:support User is asking for help / asking an implementation question. Stackoverflow would be better suited. label May 2, 2025
@sonali-kumari1
Copy link
Contributor

Hi @habib-source -

In features_list = [layer.output for layer in vgg19.layers], layers is not a method but an attribute which will return the list of all the intermediate layer activations. Please refer to this documentation for more details. Thanks!

Copy link

This issue is stale because it has been open for 14 days with no activity. It will be closed if no further activity occurs. Thank you.

@github-actions github-actions bot added the stale label May 17, 2025
@atharvadarke
Copy link

Since @sonali-kumari1 explained of layers being an attribute and not a method of class Model so I think this issue is resolved. Hence I think that this issue can be closed.

@atharvadarke
Copy link

As suggested by @sonali-kumari1 this issue close be closed.

Copy link

Are you satisfied with the resolution of your issue?
Yes
No

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:support User is asking for help / asking an implementation question. Stackoverflow would be better suited.
Projects
None yet
Development

No branches or pull requests

5 participants