C4 - W3 - Image Segmentation with U-Net AssertionError: Error in test

input_size=(96, 128, 3)
n_filters = 32
inputs = Input(input_size)
cblock1 = conv_block(inputs, n_filters * 1)
model1 = tf.keras.Model(inputs=inputs, outputs=cblock1)

output1 = [[‘InputLayer’, [(None, 96, 128, 3)], 0],
[‘Conv2D’, (None, 96, 128, 32), 896, ‘same’, ‘relu’, ‘HeNormal’],
[‘Conv2D’, (None, 96, 128, 32), 9248, ‘same’, ‘relu’, ‘HeNormal’],
[‘MaxPooling2D’, (None, 48, 64, 32), 0, (2, 2)]]

print(‘Block 1:’)
for layer in summary(model1):
print(layer)

comparator(summary(model1), output1)

inputs = Input(input_size)
cblock2 = conv_block(inputs, n_filters*32, dropout_prob=0.1, max_pooling=True)
model2 = tf.keras.Model(inputs=inputs, outputs=cblock2)

output2 = [[‘InputLayer’, [(None, 96, 128, 3)], 0],
[‘Conv2D’, (None, 96, 128, 1024), 28672, ‘same’, ‘relu’, ‘HeNormal’],
[‘Conv2D’, (None, 96, 128, 1024), 9438208, ‘same’, ‘relu’, ‘HeNormal’],
[‘Dropout’, (None, 96, 128, 1024), 0, 0.1],
[‘MaxPooling2D’, (None, 48, 64, 1024), 0, (2, 2)]]

print(’\nBlock 2:’)
for layer in summary(model2):
print(layer)

comparator(summary(model2), output2)

AFTER RUN

Block 1:
[‘InputLayer’, [(None, 96, 128, 3)], 0]
[‘Conv2D’, (None, 96, 128, 32), 896, ‘same’, ‘relu’, ‘HeNormal’]
[‘Conv2D’, (None, 96, 128, 32), 9248, ‘same’, ‘relu’, ‘HeNormal’]
[‘MaxPooling2D’, (None, 48, 64, 32), 0, (2, 2)]
All tests passed!

Block 2:
[‘InputLayer’, [(None, 96, 128, 3)], 0]
[‘Conv2D’, (None, 96, 128, 32), 896, ‘same’, ‘relu’, ‘HeNormal’]
[‘Conv2D’, (None, 96, 128, 32), 9248, ‘same’, ‘relu’, ‘HeNormal’]
[‘Dropout’, (None, 96, 128, 32), 0, 0.1]
[‘MaxPooling2D’, (None, 48, 64, 32), 0, (2, 2)]

**Test failed **
** Expected value **

** [‘Conv2D’, (None, 96, 128, 1024), 28672, ‘same’, ‘relu’, ‘HeNormal’] **

** does not match the input value: **

** [‘Conv2D’, (None, 96, 128, 32), 896, ‘same’, ‘relu’, ‘HeNormal’]**
---------------------------------------------------------------------------
AssertionError Traceback (most recent call last)
in
** 30 print(layer)**
** 31 **
—> 32 comparator(summary(model2), output2)

/tf/W3A2/test_utils.py in comparator(learner, instructor)
** 19 “\n\n does not match the input value: \n\n”,**
** 20 colored(f"{a}", “red”))**
—> 21 raise AssertionError(“Error in test”)
** 22 print(colored(“All tests passed!”, “green”))**
** 23 **

AssertionError: Error in test

Please help! I have tried so many times but cannot solve this issue

My Function’’

GRADED FUNCTION: conv_block

def conv_block(inputs=(96,128,3), n_filters=32, dropout_prob=0, max_pooling=True):
“”"
Convolutional downsampling block

Arguments:
    inputs -- Input tensor
    n_filters -- Number of filters for the convolutional layers
    dropout_prob -- Dropout probability
    max_pooling -- Use MaxPooling2D to reduce the spatial dimensions of the output volume
Returns: 
    next_layer, skip_connection --  Next layer and skip connection outputs
"""

### START CODE HERE
conv = Conv2D(32, # Number of filters
              3,   # Kernel size   
              activation='relu',
              padding='same',
              kernel_initializer='he_normal')(inputs)
conv = Conv2D(32, # Number of filters
              3,   # Kernel size
              activation='relu',
              padding='same',
              kernel_initializer='he_normal')(conv)
### END CODE HERE

# if dropout_prob > 0 add a dropout layer, with the variable dropout_prob as parameter
if dropout_prob > 0:
     ### START CODE HERE
    conv = tf.keras.layers.Dropout(dropout_prob)(conv)
     ### END CODE HERE
     
    
# if max_pooling is True add a MaxPooling2D with 2x2 pool_size
if max_pooling:
    ### START CODE HERE
    next_layer = tf.keras.layers.MaxPooling2D(pool_size=(2,2))(conv)
    ### END CODE HERE
    
else:
    next_layer = conv
    
skip_connection = conv

return next_layer, skip_connection

You are hard-coding the number of filters. That is a parameter value that’s passed in, right?

conv = Conv2D(n_filters, # Number of filters