FCN8(input_height=64, input_width=84)

Can anyone guide me a little. I went through the ungraded lab too but I am stuck at the 5 block code, not getting the desired expected output

pad the input image width to 96 pixels

x = tf.keras.layers.ZeroPadding2D(((0, 0), (0, 96-input_width)))(img_input)

the above code was already given in the assignment.

I am getting confused with the next layers block code. as per instructions pool_size and pool_stride should be kept constant at 2 which I followed. Kernal_size i used numerical, but I notice it mentions to use integer. So I want to know do I need to use as (0, 3) or just 3

I am stuck…:frowning: @ai_curious

Thank you

  1. check your model using summary(). To the best of my knowledge, that layer should look like this…
zero_padding2d (ZeroPadding2 (None, 64, 96, 1)         0         
  1. the kernel_size parameter gets passed first to conv_block() which is documented as. kernel_size (int) -- kernel_size setting of the Conv2D layers. but then forwarded on to Keras Conv2D(), where it is documented as
  • kernel_size: An integer or tuple/list of 2 integers, specifying the height and width of the 2D convolution window. Can be a single integer to specify the same value for all spatial dimensions.

my emphasis added

My takeaway is that just using an integer should work fine. My code shows that, though admittedly I took this class in 2021 and it might have changed since. HTH

1 Like

yes, exercise does seems to be changed as I checked for the same issue and it doesn’t match with the current assignment.

No the expected output is below in the image

Thank you for replying

The zero padding layer is an exact match for the one I pasted above.

yes but what I can see the first parameter is input layer, also there is a leaky layer, so I feel I should add same convolutional layer with leaky layer, but in the ungraded lab, this section is shown different for fcn8, and as I am not getting expected output. :frowning: