Skip to content
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

'LeakyReLU' object has no attribute 'inbound_nodes' #19

Open
dmitriyshashkin opened this issue May 28, 2019 · 1 comment
Open

'LeakyReLU' object has no attribute 'inbound_nodes' #19

dmitriyshashkin opened this issue May 28, 2019 · 1 comment

Comments

@dmitriyshashkin
Copy link

I'm having problems with week3/week3_task1_first_cnn_cifar10_clean.ipynb One of the last cells tries to access inbound_nodes attribute of LeakyReLU and aparently it doesn't exist anymore

TF 1.12.0
Keras 2.2.4

It's extremely easy to fix, just access the previus layer using model.layers[i - 1]

@edo91
Copy link

edo91 commented Mar 29, 2021

Agree!

Something like this should work:

for i in range(1, len(model.layers)):
    if isinstance(model.layers[i], LeakyReLU):
        prev_layer = model.layers[i-1]
        if isinstance(prev_layer, Conv2D):
            conv_activation_layers.append(model.layers[i])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants