Skip to content

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

@dmitriyshashkin

Description

@dmitriyshashkin

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]

Activity

edo91

edo91 commented on Mar 29, 2021

@edo91

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @dmitriyshashkin@edo91

        Issue actions

          'LeakyReLU' object has no attribute 'inbound_nodes' · Issue #19 · hse-aml/intro-to-dl