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