[Week 2] Residual Networks

I have an error, I am using in the AveragePooling2D(pool_size=(2,2), padding=“valid”), and also change to “same” but it displays the same result.

Test failed
Expected value

[‘Conv2D’, (None, 15, 15, 256), 16640, ‘valid’, ‘linear’, ‘GlorotUniform’]

does not match the input value:

[‘Conv2D’, (None, 15, 15, 256), 16640, ‘same’, ‘linear’, ‘GlorotUniform’]

Hey, the issue here does not seem to be related to average pooling. Can you check if you’ve used the right padding for the third component of main path, and shortcut path’s Conv2D layers in convolution_block function?

Thank you for the soon answer. I am using the following code:

X = convolutional_block(X, f = 3, filters = [512, 512, 2048], s = 2)
X = identity_block(X, 3, [512, 512, 2048])
X = identity_block(X, 3, [512, 512, 2048])

I am change the filters for each stage as well as the number of identity blocks, depending on the instructions. I am using the same information as it is constructed for the first stage. Is it missing something?

+, I have the same problem!

Can you both check the earlier implemented function convolution block and see if you’ve used the right padding in the third part of main path and shortcut path for the Conv2D layers there?

Thank you very much for the hint. I’ve corrected it and now it’s working fine.

You were right! Thank you! The error was higher in selecting “ padding ” even at the “ identity_block ” stage, rather than “ convolutional_block ”. I don’t understand how I passed the test on it XD

Glad you were both able to solve it. Good luck for the rest of the course!

thank you for sharing, just solved my own now. the Error was in the X_shortcut. I think a unit test should be added there too.

1 Like