Course 4 Week 1 Assignment 1 Pooling Exercise

In Exercise 4 of pool_forward, my code is giving correct output for the max pooling test case, but incorrect output for the average pooling test case. I used np.mean as suggested by the hints in the assignment, and although my output shape is correct, the values are not matching for average pooling. Can someone please help me out with this issue? Thank you.

If your a_prev_slice is correct (which seems as you are getting correct values for max), then try Kernel → Restart and Clear output. Then run all cells again. Let me know if it doesn’t work.

I tried that. It did not work.

Send me your code in a private message. Click my name and message…