Week 2: Residual Networks - unexpected keyword argument 'initializer'

Hi! This is the error I’m getting from the first exercise in Residual Networks. I just can’t figure out what am I missing or doing wrong. Could someone please help me?

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-22-eb060d3308af> in <module>
      8 A3 = identity_block(X, f=2, filters=[4, 4, 3],
      9                    initializer=lambda seed=0:constant(value=1),
---> 10                    training=False)
     11 print('\033[1mWith training=False\033[0m\n')
     12 A3np = A3.numpy()

TypeError: identity_block() got an unexpected keyword argument 'initializer'

Are you sure that you have not modified the function definition of identity_block? Here’s what it looks like in my notebook:

# UNQ_C1
# GRADED FUNCTION: identity_block

def identity_block(X, f, filters, training=True, initializer=random_uniform):

Yes! That was the problem. It works just fine now. Thank you so much for your help!

1 Like

It’s great that it was an easy answer. If that hadn’t worked, then I was worried. :scream_cat: Thanks for confirming!

1 Like