C4 week 3 Unet fliter output

Test failed
Expected value

[‘Conv2DTranspose’, (None, 12, 16, 256), 1179904]

does not match the input value:

[‘Conv2DTranspose’, (None, 12, 16, 32), 147488]

AssertionError Traceback (most recent call last)
in
5
6 unet = unet_model((img_height, img_width, num_channels))
----> 7 comparator(summary(unet), outputs.unet_model_output)

/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

after many attempts i’m still gettting error … help me

Hi @nikhil158. Please share your lab ID with me so I can take a look. Thanks!

goumpnby
this is my lab ID …

Hi @nikhil158, I have taken a look at your notebook.

While your Ex 3 is throwing an error, the fault actually was in Ex 2.

You are making the classic mistake of hardcoding values, which the learners are advised not to do.

You are hardcoding values in Ex 2, while it helps you pass the unit tests for Ex 2, but as expected, your code fails later on because of that.

Please fix that, and then you’ll see the rest of the code will run smoothly as well. You are passing hardcoded values of number of filters.

good luck with the rest,
Mubsi

Hi there, I have a similar problem. I have not hard-coded my filter numbers or anything else. :frowning:
I don’t know what I’m missing here. Can you please provide me with some guidance?

Test failed
Expected value

[‘Conv2D’, (None, 48, 64, 64), 18496, ‘same’, ‘relu’, ‘HeNormal’]

does not match the input value:

[‘Conv2D’, (None, 48, 64, 32), 9248, ‘same’, ‘relu’, ‘HeNormal’]

Hi @Mubsi Thanks a lot for your response.
My lab ID is : qxrlnwid

Your issue is in Ex 3, as shown by the error you shared above.

Your variables cblock2, cblock3. cblock4, cblock5 are incorrect. In these variables, you have to multiply number of filters with increasing power of 2.

Your variable conv10 is also incorrect. The first argument needs to be number of classes, but you are passing number of filters.

Cheers,
Mubsi

Thanks A LOT for your help! I see where I made those mistakes.

1 Like

Hi @Mubsi
I am geeting the following error:

Test failed
Expected value

[‘Conv2D’, (None, 96, 128, 23), 759, ‘same’, ‘linear’, ‘GlorotUniform’]

does not match the input value:

[‘Conv2D’, (None, 96, 128, 32), 1056, ‘same’, ‘linear’, ‘GlorotUniform’]

AssertionError Traceback (most recent call last)
Input In [28], 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

Please guide me for this error

@Mubsi
I already solved it. Thanks
I was using n_filters in the Conv10 instead of n_class