Image_segmentation_Unet_v2 -Unet model Test Failed

I am stuck with this exercise and no clue what’s going on. This is the first time that I am stuck with any assignment on this series of specialization courses. Any help/insight on how to solve this issue is greatly appreciated. I tried to refresh the notebook and that did not help.

This is the function that I’m asked to complete (but doesn’t provide the correct output):

def unet_model(input_size=(96, 128, 3), n_filters=32, n_classes=23):

Here’s the error I got.

Test failed
Expected value

[‘Conv2D’, (None, 12, 16, 256), 1179904, ‘same’, ‘relu’, ‘HeNormal’]

does not match the input value:

[‘Conv2D’, (None, 12, 16, 32), 147488, ‘same’, ‘relu’, ‘HeNormal’]

AssertionError Traceback (most recent call last)
Input In [13], in <cell line: 7>()
4 num_channels = 3
6 unet = unet_model((img_height, img_width, num_channels))
----> 7 comparator(summary(unet), outputs.unet_model_output)

File /tf/W3A2/test_utils.py:21, in comparator(learner, instructor)
16 if tuple(a) != tuple(b):
17 print(colored(“Test failed”, attrs=[‘bold’]),
18 “\n Expected value \n\n”, colored(f"{b}“, “green”),
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”))

AssertionError: Error in test

If this doesn’t help, please click my name and message your notebook as an attachment.

1 Like

Thank you so much @balaji.ambresh ! I hard coded the n_filters to 32 in one of the conv2D function of upsampling block that was causing the error. The error is resolved now.

1 Like