C4 W1 Convolution_model_Step_by_Step_v1 average pool error

When implementing pool_forward I am getting a wrong value error.
I have used my stride exactly as in conv_forward which works correctly.

If you have passed the conv_forward exercise and failing this one, then there might be a chance that you are making a typo or small mistake in your code. I suggest double check your code with instructions again. If still facing the issue, send me your code of this function (not whole notebook) in a private message. Click my name and message. But first, go through your code again to find the bug…

One other specific thing to point out is that there is one very significant difference between how conv layers and pooling layers work: pooling layers work “per channel” on the input channels and produce the same number of output channels. Whereas conv layers work across the input channels and give you one output channel per conv filter.

You’re right that the strides work the same way, but it’s worth checking the channels part of the logic to make sure you’ve taken that difference into account correctly.

I took @paulinpaloalto’s guidance into consideration and changed my a_slice_prev to work on each channel instead of across all channels and now my issue is resolved. Thank you @saifkhanengr and @paulinpaloalto for the help!

It’s great news that you found the solution based on our suggestions. Thanks for confirming. Onward! :nerd_face: